?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
?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
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();
3 matches
Mail list logo