[BioC] Undesirable behavior of limma MArrayLM?
Gordon K Smyth
smyth at wehi.EDU.AU
Sat Jun 28 06:44:32 CEST 2008
Hi Paul,
MArrayLM objects subset in the same way as other objects in R
(data.frames, matrices, named vectors etc), and that was a deliberate
design decision. All of them can be subsetted using logical, character or
numerical indices.
Despite your code example, I'm not actually clear in what way you found
the behaviour unexpected, or what behaviour you're suggesting would be
more desirable. It all seems to be working to me!
Regards
Gordon
----- original message ------
[BioC] Undesirable behavior of limma MArrayLM?
Paul Leo p.leo at uq.edu.au
Thu Jun 26 09:33:59 CEST 2008
Personally I don't like this kind of behavior see "#*** and comments...
It will surely catch someone out, will it use a rowname or a number ,
the joy of variable interpolation!
Do I complain too much or is this worth a fix?
> n<-8963
> fit2[8963,]$genes["ID"]
ID
8963 106220736 ## ok that's what I wanted
> fit2$genes[8961,"ID"] #**
[1] "5050440" ## oops!
> test<-fit2$genes
> test[8963,]
[1] "106220736" ## life is sane again, but now I need more caffeine!
>
> n<-8963
> fit2[n,]$genes["ID"]
ID
8963 106220736
> fit2$genes[n,"ID"] ### Works as I would expect AGAIN
[1] "106220736"
> test<-fit2$genes
> test[n,]
[1] "106220736"
>
> fit2[8963,]$genes["ID"]
ID
8963 106220736
> fit2$genes[8961,"ID"]
[1] "5050440"
> fit2$genes["8961","ID"] # Oh yes... now I get it!
[1] "5050440"
> fit2$genes[n,"ID"]
[1] "106220736"
> class(fit2)
[1] "MArrayLM"
attr(,"package")
[1] "limma"
> sessionInfo()
R version 2.7.1 RC (2008-06-16 r45949)
i386-pc-mingw32
locale:
LC_COLLATE=English_United States.1252;LC_CTYPE=English_United
States.1252;LC_MONETARY=English_United
States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] limma_2.14.5
Cheers
Paul
More information about the Bioconductor
mailing list