I am using a function in R which needs a folder named "yearXXXX" (the current year) to save the output there.
The code looks like this (The OS is macOS):
function (lastday, current_year)
{
system("rsync --remove-source-files -avh year2013 year2013_backup")
system("mkdir year2013")
system("ls temp > foo")
dayfiles <- scan("foo", "")
for (j in 1:length(dayfiles))
{
another function
}
And the question is how to use the current_year
parameter (which is for example 2013 or 2014 and is set when you want to run the function) for setting the folder name according to the year in use.
Thanks