Re: [R] How to calculate the mean of all values in a list or dataframe

2008-01-11 Thread John Kane
?lapply in the case of a list. test=list(a=1:5, b=1:4) lapply(test, mean) --- "B. Bogart" <[EMAIL PROTECTED]> wrote: > Hello all, > > I've scoured the archives and google and I can't > figure out how to > amalgamate a set of vectors of differing lengths in > such a way as I can > calculate the

Re: [R] How to calculate the mean of all values in a list or dataframe

2008-01-11 Thread Bert Gunter
?unlist mean(unlist(test)) Bert Gunter Genentch Nonclinical Statistics -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of B. Bogart Sent: Friday, January 11, 2008 11:29 AM To: r-help@r-project.org Subject: [R] How to calculate the mean of all values in a

[R] How to calculate the mean of all values in a list or dataframe

2008-01-11 Thread B. Bogart
Hello all, I've scoured the archives and google and I can't figure out how to amalgamate a set of vectors of differing lengths in such a way as I can calculate the mean easily. The following dummy example contains vectors of length 1, but my data has vectors of various lengths. R> test = list();