sep="",header=TRUE,stringsAsFactors=FALSE)
library(plyr)
ddply(dat1,.(group),summarize, f_myvar=mifunc(myvar))
# 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
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
,
Estefania
From: Sarah Goslee
To: Estefanía Gómez Galimberti
Cc: "r-help@r-project.org"
Sent: Friday, December 21, 2012 4:56 PM
Subject: Re: [R] remove from column a group of elements I have in another vector
You can probably do it with not in in
Hi,
I have a data frame and I would need to remove from one of
the columns a group of elements I have in another vector. How can I do that? I
know how to do it with criteria but i would need to do it in a more automatic
way
In SQL I would use where
not in
Thank you,
Estefania
4 matches
Mail list logo