Re: [R] Help on selecting genes showing highest variance

2011-06-10 Thread Juliet Hannah
# Let's say your expression data is in a matrix # named expression in which the rows are genes # and the columns are samples myvars <- apply(expression,1, var,na.rm=TRUE) myvars <- sort(myvars,decreasing=TRUE) myvars <- myvars[1:200] expression <- expression[names(myvars),] dim(expression) Also

[R] Help on selecting genes showing highest variance

2011-06-07 Thread GIS Visitor 33
Hi I have a problem for which I would like to know a solution. I have a gene expression data and I would like to choose only lets say top 200 genes that had the highest expression variance across patients. How do i do this in R? I tried x=apply(leukemiadata,1,var) x1=x[order(-1*x)] but the pr