I imagine script.R probably invokes the commandArgs
functionality. I don't think there's a way to 'write' to this once you've invoked R within , but once your script is open in emacs, and you have invoked R in the usual way, then step through the script as usual, but prior to any lines resembling myvar <- commandArgs()[2]
, manually set myvar (or whatever variable the script is setting!) to firstparam, rather than allowing the commandArgs to attempt to read from the original command line.
Alternatively, you can invoke R to prompt you for optional arguments to R by using C-u M-x R
and manually typing in firstparam etc, but the index of the arguments might not sync nicely between Rscript and your ESS's way of calling R, so experimentation may be needed.