Hi, neighbors!
Is there any way to write csv with different names in "for" sentence?
What I'm trying to do is make different csv files for each crop.
my code is as below
crops <- c(cocoa, coffee, maize, rice, potato, tobacco, tea, wheat) #all are dataframes
str(cocoa)
'data.frame': 292 obs. of 21 variables
mg <- NULL
for(i in crops){
mg <- merge(x=i, y=gdp, by.x="Label", by.y="Country name", all.x=true)
write.csv(mg, "i plus")
}
Thank you for your help in advance.