[R] Creating a new by variable in a dataframe

ramoss ramine.mossadegh at finra.org
Fri Oct 19 22:09:07 CEST 2012


Thanks for all the help guys.

This worked for me:

all6 <- arrange(all6, tdate,event_tim)
lt <- ddply(all6,.(tdate),tail,1) 
lt$last_trans <-'Y'
all6 <-merge(all6,lt, by.x=c("tdate","event_tim"),
by.y=c("tdate","event_tim"),all.x=TRUE)




--
View this message in context: http://r.789695.n4.nabble.com/Creating-a-new-by-variable-in-a-dataframe-tp4646782p4646799.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list