#source("stuff.R") #cautious with path# cautious in which env source is called# by default source is called in global env# source in rmd: https://bookdown.org/yihui/rmarkdown-cookbook/source-script.html
Even if the documetation are in man/ (.Rd files), for once the author recommend roxygen2. Write specific comment with the function then use roxygen2 to generate the .Rd files.
9.0.9 Writing standalone programs
commandArgs(trailingOnly=TRUE)
q(save="no", status=1) #status is an integer > 0 = error
I noticed the use of --vanilla and -S from env
Rscript--help#Combine --no-save, --no-restore, --no-site-file,# --no-init-file and --no-environ
‘sink’ diverts R output to a connection (and must be used again to
finish such a diversion, see below!).
sink can be dangerous. In a non-interactive mode you can also use your shell stdout/stderr