How do I debug Rscripts
that are run from the command line?
I am currently using the getopt
package to pass command line options, nut when the
I either use old-school print statements, or interactive analysis. For that, I first save state using save()
, and then load that into an interactive session (for which I use Emacs/ESS). That allows for interactive work using the script code on a line-by-line basis.
But I often write/test/debug the code in interactive mode first before I deploy in a littler script.