tags:

views:

109

answers:

3

I'm used to work on my R scripts with some GUI, so I can easily run commands line-by-line, then pause and inspect my objects as they are created and changed.

I currently need to work with some data on a remote server. Is it possible to run line-by-line using R console or some other application (please, not vi) that does not require real GUI?

A: 

You can put your code in a function and then debug it so it would run in a step mode. Read ?debug for more details.

mbq
+2  A: 

In ESS, the R mode for Emacs, it is trivial to run R code step-by-step.

Emacs, and hence ESS, can be run in text mode (start as emacs -nw) as well as graphical mode.

Dirk Eddelbuettel
A: 

You could use Eclipse with StatEt. Installation is a bit tricky, but it supposedly works smoothly on Linux.

http://www.walware.de/goto/statet


This only works on windows, my bad.

If you really have nothing else, you go to File>new script or File>Open script in the R console. This opens the editor in R itself. move the cursor to the line you want to run and press F5.

To be correct, F5 runs the current selection, or, if nothing selected, the line where the cursor is.

Joris Meys
Do you refer to the Windows version of R? I guess I should have mentioned that by shell I mean linux shell.
David B
You mentioned it, and I didn't think of the fact that when running R in the shell, you don't get the console...
Joris Meys
CTRL+R+3 works for me to step line by line (or by block, if recognized as such). By pressing CTRL+R and waiting a few seconds, you will get a list of commands that are more than adequate do satisfy the most sophisticated tastes.
Roman Luštrik