On 2 Oct 2003 at 16:11, Simon Fear wrote:
>
> (BTW did I ever mention here how much I prefer with() to
> attach()/forget.to.detach() ?)
>
Agreed. I learnt about with() a few weeks ago and hasn't used
attach()/forget to detach() since.
Kjetil Halvorsen
__
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
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 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,
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 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
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
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 calculate the average treatment value for each group
in two leve