Hi,

I have a dataframe "gexp_1" with 115 rows of samples and 27000 columns of gene 
expression measurements with each column corresponding to one gene. I now have 
a smaller vector of genes "tp" for which I need to pull out the data form the 
data frame.

#  first gene from the list with 16 genes

x <- tp[1,]
x
[1] geneA
16 Levels: geneA, geneB...

#unsuccessful
gexp_1$x
NULL

#or
gexp_1$x[1]
NULL

#but this works
gexp_1$geneA 

I am sure that this is a fundamental error on my part since I am new to R, I 
would appreciate any advice. I am trying to construct a for loop to analyze 
data for sets of genes at a time but stuck at this step.

Regards
Rizwan
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to