[BioC] mean of individual rows for subsets of columns in an ExprSet

Johannes Freudenberg mai98ftu at studserv.uni-leipzig.de
Thu Aug 21 11:13:09 MEST 2003


There are functions to compute row means or column means that are much faster 
than using apply():

> mns.col <- colMeans(exprs(eset)[,4:7])
> mns.row <- rowMeans(exprs(eset)[,4:7])

In S-Plus similar functions are available for variance (rowVars, colVars) and 
standard deviation (rowStdevs, colStdevs) but I didn't find them in R.

Johannes


Quoting Vincent Carey 525-2265 <stvjc at channing.harvard.edu>:

> >
> > I am sorry to disturb with yet a simple question but I have tried my
> best and have now given up on solving it myself... :(
> >
> > I wonder if somebody knows how I easily can create mean values and
> their SD from subsets of columns (representing cases) over all rows
> individually (representing the genes) from an object - eset - (which is
> an Expression Set with 12625 genes, 7 samples).
> > E.g the mean and SD from all rows individually in columns 4,5,6 and 7
> of my data?
> >
> > Grateful for help!
> >
> > // Anna :o)
> 
> mns <- apply(exprs(eset)[,4:7],2,mean)
> sds <- apply(exprs(eset)[,4:7],2,function(x)sqrt(var(x)))
> 
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at stat.math.ethz.ch
> https://www.stat.math.ethz.ch/mailman/listinfo/bioconductor
>



More information about the Bioconductor mailing list