I know that this is very easy in Phython, but I dont find any solutions in R for my problem: I want to create multiple files like that:
write.table(df, "EUmax_20J_1993.dat", row.names=TRUE, col.names=TRUE) write.table(df, "EUmax_10J_1994.dat", row.names=TRUE, col.names=TRUE) write.table(df, "EUmax_20J_1996.dat", row.names=TRUE, col.names=TRUE) write.table(df, "EUmax_10J_1993.dat", row.names=TRUE, col.names=TRUE)
In the beginning of my script I have this:
Years = 10 From = 1993
I use one script for all these outputs, I only change the amount of years and the startyear at the beginning of the script. Its running for the years I selected and then I want to adjust the output-name automatically. In Python you just combine characters with a simple plus. In R I dont get it working, I tried this:
Years = as.character(Years) From = as.character(From) write.table(df, "EUmax_J_"+Years+"_"+From+".dat", row.names=TRUE, col.names=TRUE)