[R] Turning off continuation prompt?

Gabor Grothendieck ggrothendieck at gmail.com
Mon Jul 30 13:08:15 CEST 2012


On Mon, Jul 30, 2012 at 4:58 AM, Ted Harding <Ted.Harding at wlandres.net> wrote:
> Greetings All.
> My apologies for a question whose answer is probably
> readily available somewhere (for some interpetation
> of "somewhere") ...
>
> Say I have just typed (from a sheet of paper) several
> lines into the R command-line, and what I see is:
>
>> chisq.test(matrix(c(3,6,3,4,4,
> +                     4,1,4,6,5,
> +                     2,7,4,2,5,
> +                     8,2,4,4,2,
> +                     3,4,5,4,4),ncol=5))
>
> Later, I find that would like to re-input the data part
> of this command ("matrix(c(...)...)"). Without the "+"
> continuation prompts, it would be easy to do this by
> copy&paste with the mouse in one operation. With the "+"
> marks there, I have to do the copy&paste for each separate line.
>
> So is there a way to suppress the output of the "+" at the
> beginning of each continuation line?
>
> (The above is one of the smaller examples of this situation;
> sometimes I have wished to do this for commands extending over,
> say, 15-20 lines).
>

On Windows just copy the command to the clipboard and the use Edit |
Paste Commands to paste them back (as opposed to just Paste) in and it
will remove the leading junk on each line as it pastes it in.

Another possibility which is not specific to Windows is to issue:

history()

and then copy from the history -- the history output has no leading
junk in the first place.

-- 
Statistics & Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com



More information about the R-help mailing list