I'm looping in data frames based off of IDs in the names of CSVs in R.
I want to further manipulate the data frames once I create them in the loop.
The code works up until the last line of the code, outfile<-cbind(outfile,ID)
. This simply creates a variable named outfile. I want it to reference the most recent data frame just created in a loop. I've tried paste(outfile)<-cbind
but I get the error " could not find function "paste<-"".
for (ID in IDs) {
infile<-paste("data/raw_data/DEV001/DEV001ID",ID,"_Sensor1_Raw.csv",sep="")
outfile<-paste("DEV002ID",ID,"Raw",sep="")
importing<-read.csv(file=infile,header=TRUE,sep=',') #import dataset
assign(outfile,importing)
outfile<-cbind(outfile,ID)
}