An alternative to renaming columns in the ouput of aggregate is to
provide names in the by list as follows:
aggregate(df$treatment, list(gp=df$group, dup=df$duplicate), mean)
hope this helps. spencer graves
Marc Schwartz wrote:
On Wed, 2003-10-01 at 20:15, [EMAIL PROTECTED] wrote:
Hello,
On Thu, 2003-10-02 at 08:47, Spencer Graves wrote:
An alternative to renaming columns in the ouput of aggregate is to
provide names in the by list as follows:
aggregate(df$treatment, list(gp=df$group, dup=df$duplicate), mean)
hope this helps. spencer graves
SNIP
Spencer,
Yeah, knew
A little more succinctly and I hope also helpful:
with(df, aggregate(list(mean=treatment),
list(group = group, duplicate = duplicate), mean))
Note that the name of the summary of treatment is likely
best to be different from the name of the treatment
variable itself. It is tempting to do
On Thu, 2003-10-02 at 10:11, Simon Fear wrote:
A little more succinctly and I hope also helpful:
with(df, aggregate(list(mean=treatment),
list(group = group, duplicate = duplicate), mean))
Note that the name of the summary of treatment is likely
best to be different from the name
Have you considered aggregate?
hope this helps. spencer graves
[EMAIL PROTECTED] wrote:
Hello, R experts:
I got data like this:
group duplicate treatment
A Y 5
A Y 3
A N 6
B Y 2
B N 4
B Y
On Wed, 2003-10-01 at 20:15, [EMAIL PROTECTED] wrote:
Hello, R experts:
I got data like this:
group duplicate treatment
A Y 5
A Y 3
A N 6
B Y 2
B N 4
B Y 1
How to sort the data and