I have a function which takes multiple csv files and processes them into an excel file.
#review.R
review <- function(... ,savename) {
somecodes
}
and I have these files in my folder:
fileA.csv
fileB.csv
fileC.csv
fileD.csv
...
and this is how I run it:
review("fileA","fileB","fileC","fileD", savename="analysis")
And then it processes and outputs "analysis.xlsx"
I have no problem running it in RStudio, but I really would like to run my script in cmd line like this:
rscript.exe f_wrapper.r "fileA" "fileB" "fileC" "fileD" savename="analysis"
This is my f_wrapper.R
#f_wrapper.R
#this script doesn't work at all
args <- commandArgs(TRUE)
obj <- list(...)
source("my_R_folder/review.R")
review(obj)
I googled all over but all I could find was passing fixed arguments like a,b,c but I am trying to pass a,b,c,d,e .... and more arguments to my function.
Please help.