Re: [R] help with median for each row

2009-08-22 Thread Jim Lemon
Jim Lemon wrote: Edward Chen wrote: Hi, I tried looking through google search on whether there's a way to computer 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 specif

Re: [R] help with median for each row

2009-08-22 Thread Jim Lemon
Edward Chen wrote: Hi, I tried looking through google search on whether there's a way to computer 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

Re: [R] help with median for each row

2009-08-21 Thread Matthias Kohl
if your matrix has many rows you might want to consider rowMedians from Bioconductor package Biobase. hth, Matthias Greg Hirson schrieb: Edward, See ?apply x = matrix(rnorm(100), ncol = 10) apply(x, 1, median) Hope this helps, Greg Edward Chen wrote: Hi, I tried looking through google se

Re: [R] help with median for each row

2009-08-21 Thread Greg Hirson
Edward, See ?apply x = matrix(rnorm(100), ncol = 10) apply(x, 1, median) Hope this helps, Greg Edward Chen wrote: Hi, I tried looking through google search on whether there's a way to computer the median for each row of a nxn matrix and return the medians for each row for further computatio

Re: [R] help with median for each row

2009-08-21 Thread Erik Iverson
August 21, 2009 11:50 AM To: r-help@r-project.org Subject: [R] help with median for each row Hi, I tried looking through google search on whether there's a way to computer the median for each row of a nxn matrix and return the medians for each row for further computation. And also if the numbe

Re: [R] help with median for each row

2009-08-21 Thread stephen sefick
?apply specifically the MARGINS argument On Fri, Aug 21, 2009 at 11:50 AM, Edward Chen wrote: > Hi, > > I tried looking through google search on whether there's a way to computer > the median for each row of a nxn matrix and return the medians for each row > for further computation. > And also if

[R] help with median for each row

2009-08-21 Thread Edward Chen
Hi, I tried looking through google search on whether there's a way to computer 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 muc