[R] help with median for each row
Matthias.Kohl at stamats.de
Fri Aug 21 19:05:56 CEST 2009
if your matrix has many rows you might want to consider rowMedians from
Bioconductor package Biobase.
Greg Hirson schrieb:
> See ?apply
> x = matrix(rnorm(100), ncol = 10)
> apply(x, 1, median)
> Hope this helps,
> Edward Chen wrote:
>> I tried looking through google search on whether there's a way to
>> the median for each row of a nxn matrix and return the medians for
>> each row
>> for further computation.
>> And also if the number of columns in the matrix are even, how could I
>> specify which median to use?
>> Thank you very much!
Dr. Matthias Kohl
More information about the R-help