I have written a short script as an R-executable. How can I define the working directory the folder in which the script file is?
Cannot find the C# analogy of
path = Directory.GetCurrentDirectory()
Thank you,
I have written a short script as an R-executable. How can I define the working directory the folder in which the script file is?
Cannot find the C# analogy of
path = Directory.GetCurrentDirectory()
Thank you,
It seems like this is a duplicate question, where a useful answer was provided.
By using the commandArgs(trailingOnly = FALSE)
option, it is possible to return the whole set of arguments passed (including the executable and the filename, not just the arguments for the script). This will include the origin file provided when running Rscript file.R
(for example).