#5 group3 6 e 500 500
#6 group4 7 f 600 NA
A.K.
From: Estefanía Gómez Galimberti
To: arun
Cc: R help
Sent: Thursday, May 23, 2013 12:08 PM
Subject: Re: [R] apply function within different groups
Thanks a lot!!! It works perkectly!
Just
group4 7 f 600 NA
A.K.
From: Estefanía Gómez Galimberti
To: arun
Cc: R help
Sent: Thursday, May 23, 2013 12:08 PM
Subject: Re: [R] apply function within different groups
Thanks a lot!!! It works perkectly!
Just one thing, is there a way to prese
Galimberti
Cc: R help
Sent: Thursday, May 23, 2013 12:48 PM
Subject: Re: [R] apply function within different groups
Hi,
May be this helps:
dat1<- read.table(text="
group var1 var2 myvar
group1 1 a 100
group2 2 b 200
group2 34 c 300
group3 5 d 400
group3 6 e 500
group4 7 f 600
",
)
# group f_myvar
#1 group1 NA
#2 group2 299
#3 group2 300
#4 group3 499
#5 group3 500
#6 group4 NA
A.K.
- Original Message -
From: Estefanía Gómez Galimberti
To: r help help
Cc:
Sent: Thursday, May 23, 2013 11:30 AM
Subject: [R] apply function within dif
Hi,
I have a very big data frame and I would like to apply a function to one of the
columns within different groups and obtain another dataframe
My data frame is like this:
group var1 var2 myvar
group1 1 a 100
group2 2 b 200
group2 34 c 300
group3 5 d 400
group3 6 e 500
group4 7 f 600
5 matches
Mail list logo