Tim Triche, Jr.
2013-Feb-06 15:34 UTC
[Rd] [R] slotName defined in object, present in instance, but inaccessible [SCL:4]
from a package I'm writing.... ##setClass('Occupancy',contains="DataFrame", ## representation(states="StatesORNULL")) ## R> foo <- occupancy(pooledMethSegs) R> plotOccupancy(foo) Error in slot(object, "states") : no slot of name "states" for this object of class "Occupancy" R> slotNames(foo) [1] "states" "rownames" "nrows" "listData" [5] "elementType" "elementMetadata" "metadata" R> foo@states Error: no slot of name "states" for this object of class "Occupancy" Any ideas as to what's going on here? R> sessionInfo() R Under development (unstable) (2013-01-29 r61783) Platform: x86_64-unknown-linux-gnu (64-bit) locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 [7] LC_PAPER=C LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] grid parallel stats graphics grDevices datasets utils [8] methods base other attached packages: [1] rtracklayer_1.19.9 chromophobe_0.49 pheatmap_0.7.4 [4] ggplot2_0.9.3 reshape2_1.2.2 GenomicRanges_1.11.28 [7] IRanges_1.17.31 BiocGenerics_0.5.6 BiocInstaller_1.9.6 [10] gtools_2.7.0 devtools_1.0 loaded via a namespace (and not attached): [1] Biostrings_2.27.10 bitops_1.0-5 BSgenome_1.27.1 colorspace_1.2-1 [5] dichromat_2.0-0 digest_0.6.2 evaluate_0.4.3 gtable_0.1.2 [9] httr_0.2 labeling_0.1 lattice_0.20-13 MASS_7.3-23 [13] Matrix_1.0-10 memoise_0.1 munsell_0.4 plyr_1.8 [17] proto_0.3-10 RColorBrewer_1.0-5 RCurl_1.95-3 Rsamtools_1.11.15 [21] scales_0.2.3 stats4_3.0.0 stringr_0.6.2 tools_3.0.0 [25] whisker_0.1 XML_3.95-0.1 zlibbioc_1.5.0 [[alternative HTML version deleted]]
Apparently Analagous Threads
- slotName defined in object, present in instance, but inaccessible [SCL:4]
- wishlist -- names gives slotnames (PR#7410)
- Method for $
- surprisingly, S4 classes with a "dim" or "dimnames" slot are final (in the Java sense)
- slot(obj, "nosuch") documentation question