[Rd] R --interactive -e 'browser()'

irederik m@iii@g oii oib@@et irederik m@iii@g oii oib@@et
Fri Feb 21 06:25:23 CET 2020


I would like to have a mode where I can run some R code in an executable script, like with Rscript, but interactively, so that e.g. 'browser()' works.

 From the manual page it looks like this should work:

     R --interactive -e 'source("script.R")'

or we could shorten it to:

     R --interactive -e 'browser()'

However, it seems that --interactive causes -e to be ignored.

And if I leave out --interactive, then R quits before the browser() function exits.

 From an engineering standpoint it doesn't seem like it should be very difficult to tell the interactive REPL to pretend that a certain command was entered before everything else. Also, it would be useful to me to be able to debug R scripts using standard features like 'browser()'. Should I submit a feature request on Bugzilla, or maybe someone can advise me how to proceed?

Thanks,

Frederick



More information about the R-devel mailing list