Re: [R] sapply and median, possible or not ?

2008-11-07 Thread Ptit_Bleu
Unfortunately, I have the same error message. lapply(rowsplit, function(x)mean(x[,sapply(x, is.numeric)])) works but not with median. Strange, isn't it? Any other idea? Thanks in advance, Ptit Bleu. Henrique Dallazuanna wrote: Try this: lapply(l, function(x)median(x[,sapply(x,

Re: [R] sapply and median, possible or not ?

2008-11-07 Thread Henrique Dallazuanna
You can provide a example of your data? On Fri, Nov 7, 2008 at 9:14 AM, Ptit_Bleu [EMAIL PROTECTED] wrote: Unfortunately, I have the same error message. lapply(rowsplit, function(x)mean(x[,sapply(x, is.numeric)])) works but not with median. Strange, isn't it? Any other idea? Thanks in

Re: [R] sapply and median, possible or not ?

2008-11-07 Thread Keith Jewell
I haven't looked at the detail, but I guess the answer is that mean works on a data frame while median doesn't. ?mean snip For a data frame, a named vector with the appropriate method being applied column by column. - I guess to use median you'll need nested '[l/s]apply's, the

[R] sapply and median, possible or not ?

2008-11-07 Thread Ptit_Bleu
Hello, I have a list of data.frame rowsplit : List of 15 $ (0,0.025] :'data.frame': 169 obs. of 7 variables: $ (0.025,0.05]:'data.frame': 174 obs. of 7 variables: $ (0.05,0.075]:'data.frame': 92 obs. of 7 variables: $ (0.075,0.1] :'data.frame': 76 obs. of 7 variables: $