I have a dataset with three column
Date1 StudentId Status
08/04/2014 155261 Yes
08/04/2014 155261 No
08/25/2014 236991 Yes
08/27/2014 236991 Yes
08/29/2014 236991 Yes
I am trying to aggregate the Status by Id and Date1, such that the final dataset will be like this
Date1 StudentId Response
08/04/2014 155261 Yes, No
08/25/2014 236991 Yes
08/27/2014 236991 Yes
08/29/2014 236991 Yes
I tried using the gsub function but it didnt work, it only aggregates based on StudentId and skips the Date, any help on this issue is much appreciated.
dataset1[,Response:=gsub("(, )+$","",c(paste(Status,collapse=", "),rep("",.N-1))),by=c("StudentId ","Date1")]