Re: [R] Get median of each column

2009-01-28 Thread Stephan Kolassa
Thank you, Rolf, for this well-deserved spanking :-) I promise to amend my ways and think before I send in the future. Best, Stephan Rolf Turner schrieb: On 29/01/2009, at 8:39 AM, Stephan Kolassa wrote: Assuming your data are in a data.frame called dataset, apply(dataset,2,median) should

Re: [R] Get median of each column

2009-01-28 Thread Rolf Turner
On 29/01/2009, at 8:39 AM, Stephan Kolassa wrote: Assuming your data are in a data.frame called dataset, apply(dataset,2,median) should work. Look at ?apply Note that apply() works with ***matrices***. The foregoing code will work, given that all columns of ``dataset'' are numeric, due to

Re: [R] Get median of each column

2009-01-28 Thread Stephan Kolassa
Assuming your data are in a data.frame called dataset, apply(dataset,2,median) should work. Look at ?apply HTH, Stephan Frank Zhang schrieb: I am new to R. How can I get column median? Thanks.Frank [[alternative HTML version deleted]]

Re: [R] Get median of each column

2009-01-28 Thread jim holtman
?apply > x <- matrix(1:25,5) > x [,1] [,2] [,3] [,4] [,5] [1,]16 11 16 21 [2,]27 12 17 22 [3,]38 13 18 23 [4,]49 14 19 24 [5,]5 10 15 20 25 > apply(x, 2, median) [1] 3 8 13 18 23 > On Wed, Jan 28, 2009 at 11:48 AM, Frank

[R] Get median of each column

2009-01-28 Thread Frank Zhang
I am new to R. How can I get column median? Thanks.Frank [[alternative HTML version deleted]] __ 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/pos