You might take a look at the transformBy function in the doBy package
For example,
new.df=transformBy(~group,data=my.df, new=y/max(y))
David Freedman
baptiste auguie-2 wrote:
Dear list,
I have a data.frame with x, y values and a 3-level factor group,
say. I want to create a new
Dear list,
I have a data.frame with x, y values and a 3-level factor group,
say. I want to create a new column in this data.frame with the values
of y scaled to 1 by group. Perhaps the example below describes it best:
x - seq(0, 10, len=100)
my.df - data.frame(x = rep(x, 3), y=c(3*sin(x),
On 12/10/2008 12:02 PM, baptiste auguie wrote:
Dear list,
I have a data.frame with x, y values and a 3-level factor group, say.
I want to create a new column in this data.frame with the values of y
scaled to 1 by group. Perhaps the example below describes it best:
x - seq(0, 10, len=100)
On Wed, Dec 10, 2008 at 11:02 AM, baptiste auguie [EMAIL PROTECTED] wrote:
Dear list,
I have a data.frame with x, y values and a 3-level factor group, say. I
want to create a new column in this data.frame with the values of y scaled
to 1 by group. Perhaps the example below describes it best:
baptiste auguie wrote:
Dear list,
I have a data.frame with x, y values and a 3-level factor group, say.
I want to create a new column in this data.frame with the values of y
scaled to 1 by group. Perhaps the example below describes it best:
x - seq(0, 10, len=100)
my.df - data.frame(x =
Excellent! I completely forgot its name and existence. Perhaps ave
should be mentioned on the help page of either by, tapply, split.
Many thanks,
baptiste
On 10 Dec 2008, at 17:20, Chuck Cleland wrote:
On 12/10/2008 12:02 PM, baptiste auguie wrote:
Dear list,
I have a data.frame with x,
On 10 Dec 2008, at 17:25, hadley wickham wrote:
On Wed, Dec 10, 2008 at 11:02 AM, baptiste auguie
[EMAIL PROTECTED] wrote:
Dear list,
I have a data.frame with x, y values and a 3-level factor group,
say. I
want to create a new column in this data.frame with the values of y
scaled
to 1
7 matches
Mail list logo