I have many years of data, each in an identical dataframe, I want to put all the years into a list and then write one for loop instead of repeating the command for each year.
#set dummies as factors (these dummies repeat across years)
mydummies<-c ('hru_i', 'ge_nonngsother_i','ge_sgt_i')
DF2012[,mydummies]<-lapply(DF2012[,mydummies],factor)
DF2013[,mydummies]<-lapply(DF2013[,mydummies],factor)
I tried to put all the dataframes in a list so that I could run a loop, but it did not change the dataframes...
df.list<- list(DF2012,DF2013)
#want to create a loop here