data<-data.frame( ID=c(1,1,1,1,2,2,2,3,3,3,3,3), Date=c("date1", "date2","date3","date4","date1", "date2&qu