I have a data frame that looks like this:
index ID date Amount 2 1001 2010-06-08 0 21 1001 2010-10-08 10 6 10
may be like this
IDs<-unique(df$ID) for (i in 1:length(IDs)){ temp <- df[df$ID==IDs[i],] #more things to do with temp }