data1=s%>%data.table()%>%setnames(c("id", "duration","M1","M2","M3","M4","M5","M6"))%>%split(.$id)%>%lapply(function(g){tail(g,4)})
Standard input is empty
Standard output is empty
Error: could not find function "%>%" Execution halted
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!