[BioC] Error in .Call("R_shortRowNames", x, type, PACKAGE = "base") : "R_shortRowNames" not available for .Call() for package "base"

Hervé Pagès hpages at fhcrc.org
Thu Oct 11 07:36:08 CEST 2012


Hi Tim,

You can use

   .Internal(shortRowNames(x, type))

or

   base:::.row_names_info(x, type)

instead. But keep in mind that, like

   .Call("R_shortRowNames", x, type, PACKAGE="base")

those things are not part of the API so they will break too
the day R core decides to change them to something else.

AFAICT, this is low-level stuff for accessing the internals of a
data frame. After a quick look at the code, it seems that only 0L,
1L, or 2L are valid 'type' values:

   > x <- data.frame(aa=letters[1:6])
   > x
     aa
   1  a
   2  b
   3  c
   4  d
   5  e
   6  f

   > y <- data.frame(aa=letters[1:6], row.names=1:6)
   > y
     aa
   1  a
   2  b
   3  c
   4  d
   5  e
   6  f

   > identical(x, y)
   [1] TRUE
   > identical(x, y, attrib.as.set=FALSE)
   [1] FALSE

   > base:::.row_names_info(x, type=2L)
   [1] 6
   > base:::.row_names_info(y, type=2L)
   [1] 6

   > base:::.row_names_info(x, type=1L)
   [1] -6
   > base:::.row_names_info(y, type=1L)
   [1] 6

   > base:::.row_names_info(x, type=0L)
   [1] NA -6
   > base:::.row_names_info(y, type=0L)
   [1] NA  6

I wonder what are the reasons for using this in a package instead of
higher-level nrow(x) and rownames(x), which are part of the API and
documented.

H.


On 10/10/2012 12:04 PM, Tim Triche, Jr. wrote:
> D'oh.  Not sure what's going on here.  Google leads me to this:
>
> https://code.google.com/p/renjin/
>
> Which is very cool, but does not solve my present problem. I can't seem to
> pull a matrix out of an eSet-derived object, which is making life difficult
> at the moment.
>
> R> sessionInfo()
> R Under development (unstable) (2012-10-08 r60907)
> Platform: x86_64-unknown-linux-gnu (64-bit)
>
> locale:
>   [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
> LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
> LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
>   [7] LC_PAPER=C                 LC_NAME=C                  LC_ADDRESS=C
>            LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8
> LC_IDENTIFICATION=C
>
> attached base packages:
> [1] stats     graphics  grDevices datasets  utils     methods   base
>
> other attached packages:
>   [1] MASS_7.3-22                        methylumi_2.5.0
>   ggplot2_0.9.2.1                    reshape2_1.2.1
>   [5] scales_0.2.2                       impute_1.33.0
>   regulatoR_0.9.25                   FDb.InfiniumMethylation.hg19_1.0.4
>   [9] Biostrings_2.27.2                  GenomicFeatures_1.11.1
> AnnotationDbi_1.21.0               rtracklayer_1.19.0
> [13] GenomicRanges_1.11.0               IRanges_1.17.0
> Matrix_1.0-9                       lattice_0.20-10
> [17] Biobase_2.19.0                     BiocGenerics_0.5.0
> BiocInstaller_1.9.4                dataframe_2.5
> [21] devtools_0.8                       gtools_2.7.0
>
> loaded via a namespace (and not attached):
>   [1] annotate_1.37.0    biomaRt_2.15.0     bitops_1.0-4.1
> BSgenome_1.27.0    colorspace_1.1-1   DBI_0.2-5          dichromat_1.2-4
>   digest_0.5.2       edgeR_3.1.0
> [10] evaluate_0.4.2     grid_2.16.0        gtable_0.1.1       httr_0.1.1
>        labeling_0.1       limma_3.15.2       memoise_0.1        munsell_0.4
>         parallel_2.16.0
> [19] plyr_1.7.1         proto_0.3-9.2      RColorBrewer_1.0-5
> RCurl_1.95-0.1.2   Repitools_1.5.0    Rsamtools_1.11.1   RSQLite_0.11.2
> stats4_2.16.0      stringr_0.6.1
> [28] tools_2.16.0       whisker_0.1        XML_3.95-0.1       xtable_1.7-0
>        zlibbioc_1.5.0
>
>

-- 
Hervé Pagès

Program in Computational Biology
Division of Public Health Sciences
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N, M1-B514
P.O. Box 19024
Seattle, WA 98109-1024

E-mail: hpages at fhcrc.org
Phone:  (206) 667-5791
Fax:    (206) 667-1319



More information about the Bioconductor mailing list