[R] Re-execute previous command

akea013 akean at clear.net.nz
Tue Feb 9 21:14:49 CET 2010


On Feb 10, 5:21 am, mnstn <pavan.n... at gmail.com> wrote:
> Hello All,
> In bash, to re-execute a command, say,  'gnuplot plot.gnu', one can type
> !gnu. Is there a similar feature in the R console? For example:
> plot(g1$mean,g2$mean)
> .
> .
> .
> Lines, many lines of commands
> ->Here I want to repeat the previous plot command.
> !plot and plot(+TAB) do not work.
>
> This question was asked in this forum back in 2006 but the answer seems to
> have been lost somewhere in their discussions. This is the threadhttp://n4.nabble.com/R-command-line-need-intelligent-command-history-...
> . Can some one comment if there is a way to do it?
>
> Thank you,
> MoonStone
> --

In bash, you can also use
    Ctrl-R plot
to see the previous plot command -
then
    Ctrl-R
repeatedly to cycle through them all.
    Ctrl-S
to search forward on the same text.
Press enter to execute the one you want - or edit, etc.
This also works in the R console for me.
--
Anita



More information about the R-help mailing list