I have a large data set(csv) of temperatures which I have to subset by date (years) to create 5 smaller ones by decade. So data from the years 1960-1969 will be one smaller csv file , data from years 1970-1979 will be another csv file etc. I've been trying to do this using a for loop
so something like this :
IDs<-unique(df$ID)
for (i in 1:length(IDs)){
temp <- df[df$ID==IDs[i],]
#more things to do with temp
}
But I'm not sure exactly how to go about this. The for loop should create the new csv files that have been subsetted by date from the existing large data set.