579.4 473.2 585.1 508.3 643.7 432.1 587.2 547.6 506.2
#9 471.8 321.0 375.8 394.4 355.5 434.4 532.1 640.5 490.1 619.1
#10 356.6 434.3 403.9 445.0 416.2 532.8 570.9 548.9 697.9 488.8
A.K.
- Original Message -
From: ya
To: r-help
Cc:
Sent: Saturday, January 19, 2013 9:49 AM
Subject: [R]
p-boun...@r-project.org [mailto:r-help-bounces@r-
> project.org] On Behalf Of ya
> Sent: Saturday, January 19, 2013 8:50 AM
> To: r-help
> Subject: [R] calculating mean matrix
>
> Hi list,
>
> Thank you vey much for reading this post.
>
> I have a data frame, I am trying
One way using `Reduce`:
set.seed(45)
grp <- factor(rep(letters[1:10], each=10)) # equivalent of your column x
# dummy data
df <- as.data.frame(matrix(sample(1:1000, replace=T),
ncol=length(levels(grp
# solution
Reduce('+', split(df, grp))/length(levels(grp))
Arun
On Saturday, January 1
Associate Professor of Anthropology
Texas A&M University
College Station, TX 77843-4352
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
> project.org] On Behalf Of ya
> Sent: Saturday, January 19, 2013 8:50 AM
> To: r-help
> Subj
Hi list,
Thank you vey much for reading this post.
I have a data frame, I am trying to split it into a couple of data frame using
one of the columns, say, x. After I get the data frames, I am planning to treat
them as matrices and trying to calculate an element by element mean matrix.
Could an
5 matches
Mail list logo