Displaying 1 result from an estimated 1 matches for "daterep".
2011 Aug 23
3
ddply - how to transform df column "in place"
Dear R-users,
I am trying to get the plyr syntax right, without much success.
Given:
d<- data.frame(cbind(x=1,y=seq(20100801,20100830,1)))
names(d)<-c("first", "daterep")
d2<-d
# I can convert the daterep column in place the classic way:
d$daterep<-as.Date(strptime(d$daterep, format="%Y%m%d"))
# How to do it the plyr way?
ddply(d2, c("daterep"), function(df){as.Date(df, format="%Y%m%d")})
# returns: Error in as.Date.defau...