Accessing attributes of object
2
0
Entering edit mode
David ▴ 860
@david-3335
Last seen 6.0 years ago
I have the following object (summary of tukeyHSD). How can i retrieve the characters "S-H" "SI-H" and "SI-S" I though that tuk.dat$disease[x,] would do it but is not, neither tuk.dat$disease[[x]] Can you help me ? str(tuk.dat$disease) num [1:3, 1:4] 25.245 -0.176 -25.421 14.653 -9.512 ... - attr(*, "dimnames")=List of 2 ..$ : chr [1:3] "S-H" "SI-H" "SI-S" ..$ : chr [1:4] "diff" "lwr" "upr" "p adj"
• 851 views
ADD COMMENT
0
Entering edit mode
David ▴ 860
@david-3335
Last seen 6.0 years ago
Finally managed to do it... rownames(tuk.dat$disease[])[x] On 29/07/10 14:12, David martin wrote: > I have the following object (summary of tukeyHSD). How can i retrieve > the characters "S-H" "SI-H" and "SI-S" > > I though that tuk.dat$disease[x,] would do it but is not, neither > tuk.dat$disease[[x]] > > Can you help me ? > > str(tuk.dat$disease) > num [1:3, 1:4] 25.245 -0.176 -25.421 14.653 -9.512 ... > - attr(*, "dimnames")=List of 2 > ..$ : chr [1:3] "S-H" "SI-H" "SI-S" > ..$ : chr [1:4] "diff" "lwr" "upr" "p adj" > > _______________________________________________ > Bioconductor mailing list > Bioconductor at stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: > http://news.gmane.org/gmane.science.biology.informatics.conductor >
ADD COMMENT
0
Entering edit mode
@joern-toedling-3465
Last seen 9.6 years ago
Hi, this is not really a Bioconductor question and should have been asked on the more general R-help list. Nevertheless, the answer is given on the help page of TukeyHSD. Each element of the result list is a matrix and can be accessed accordingly. So tuk.dat$disease[1,1] will return the first element of the matrix (see ?Extract) and rownames(tuk.dat$disease[1,1]) will return its row names. HTH, Joern On Thu, 29 Jul 2010 14:12:04 +0200, David martin wrote > I have the following object (summary of tukeyHSD). How can i > retrieve the characters "S-H" "SI-H" and "SI-S" > > I though that tuk.dat$disease[x,] would do it but is not, neither > tuk.dat$disease[[x]] > > Can you help me ? > > str(tuk.dat$disease) > num [1:3, 1:4] 25.245 -0.176 -25.421 14.653 -9.512 ... > - attr(*, "dimnames")=List of 2 > ..$ : chr [1:3] "S-H" "SI-H" "SI-S" > ..$ : chr [1:4] "diff" "lwr" "upr" "p adj" > > _______________________________________________
ADD COMMENT

Login before adding your answer.

Traffic: 899 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6