factorial(10)
# should return the same value
xfun::Rscript_call("factorial", list(10))
# the first argument can be either a character string or a function
xfun::Rscript_call(factorial, list(10))
# Run Rscript starting a vanilla R session
xfun::Rscript_call(factorial, list(10), options = c("--vanilla"))
Run the code above in your browser using DataLab