Entering edit mode
li lilingdu
▴
450
@li-lilingdu-1884
Last seen 6.5 years ago
Hello,
> library(IRanges) > dat<-IRanges(1,10) > unlist(dat) Error in (function (classes, fdef, mtable) : unable to find an inherited method for function ‘getListElement’ for signature ‘"IRanges"’ > as(dat,'vector') Error in as.vector(from) : no method for coercing this S4 class to a vector > as(dat,'integer') Error in as.vector(x, mode = "integer") : no method for coercing this S4 class to a vector
> sessionInfo() R version 3.5.0 (2018-04-23) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 17134) Matrix products: default locale: [1] LC_COLLATE=Chinese (Simplified)_China.936 LC_CTYPE=Chinese (Simplified)_China.936 LC_MONETARY=Chinese (Simplified)_China.936 LC_NUMERIC=C [5] LC_TIME=Chinese (Simplified)_China.936 attached base packages: [1] stats4 parallel stats graphics grDevices utils datasets methods base other attached packages: [1] IRanges_2.14.10 S4Vectors_0.18.2 BiocGenerics_0.26.0 loaded via a namespace (and not attached): [1] compiler_3.5.0
Hi ,
Thanks for your reply.
in previous version of IRanges and S4Vectors
would give the result of integer vector 1:10
And there exists method of 'unlist' for 'List':
I see, you're quite right. We'll have to wait for an IRanges expert to respond.
For now I guess you'll just have to use
IRanges:::unlist_as_integer()
. I'm hoping that there is a way to achieve the same effect in the future using an exported entry point.