I'm attempting to debug a script "normalize.R" that uses argparse in R and the way I came up with is to make a script that sources the other script so I can debug.
I attempted the method of overwriting the commandArgs() function to return a list, but it seems that argparse doesn't use that function. Printing commandArgs() shows the expected arguments but printing output of argparse$parse_args() does not
commandArgs <- function(trailingOnly=True){
return(c("--args", "--arg1", "foo", "--arg2", "fey"))
}
source("./normalize.R")
Is there a way to pass arguments to a script that uses argparse from R instead of the command line?
Also better workflows for debugging are also appreciated, but my curiosity is now peaked about how parse_args() works