I have data from 2011 to 2016 and each is located in a separate folder as for example in 2011 folder, the 2011 data are located and in 2012, the data for 2012 and the same rule applies to data from 2013 to 2016.
I would like to do a for loop. So is there a way that I can do? Thank you for your help and consideration.
Instead of doing like this:
data11<-
read.delim("./Vegetation_Processed/2011/ForageMass_2011_all.dat", header = TRUE, sep ="",stringsAsFactors = FALSE)
data12<-
read.delim("./Vegetation_Processed/2012/ForageMass_2012_all.dat", header = TRUE, sep ="",stringsAsFactors = FALSE)
data13<-
read.delim("./Vegetation_Processed/2013/ForageMass_2013_all.dat", header = TRUE, sep ="",stringsAsFactors = FALSE)
data131 <-
read.xlsx("./Vegetation_Raw/2013/ForageAnalysis_2013_all.xlsx",sheetIndex=1)
I would like to have a loop and combined all the data in the same file.