Re: [S] copying and pasting blocks of commands

Jens Oehlschlaegel (oehl@Psyres-Stuttgart.DE)
Wed, 1 Jul 1998 13:34:27 +0200 (MET DST)


options (prompt="; ", continue=";; ")

# looks like a nice trick
# but refrain from having a single command extended over several lines
# as e.g.
c("line 1"
, "line 2"
, "line 3"
)

# which looks like
; c("line 1"
;; , "line 2"
;; , "line 3"
;; )
[1] "line 1" "line 2" "line 3"

# cutting and pasting gives
; ; c("line 1"
NULL
; ;; ;; , "line 2"
Syntax error: ";" used illegally at this point:
c("line 1"
;
; ;; , "line 3"
NULL
; NULL
; Syntax error: "," used illegally at this point:
,
; ;; )
NULL
; NULL
; Syntax error: No opening parenthesis, before ")" at this point:
)

# Instead try
options (prompt="\n ", continue=" ")

# then
c("line 1"
, "line 2"
, "line 3"
)

# looks like

c("line 1"
, "line 2"
, "line 3"
)
[1] "line 1" "line 2" "line 3"


# and cutting and pasting gives

c("line 1"
, "line 2"
, "line 3"
)
[1] "line 1" "line 2" "line 3"

But perhaps using the history function or even an editor is more helpful.

Best regards

Jens Oehlschlaegel-Akiyoshi

On Wed, 1 Jul 1998, Andreas Krause wrote:

> Here is a tip that you might find useful.
> If blocks of S-PLUS commands stretching over several input lines are to be
> re-executed, copy and paste is a way of doing it.
> This is cumbersome though, as one has to do it line by line in order to avoid
> copying the S-PLUS prompt (">"). So why not make the prompt compatible with
> what we want to do and set it to something like ";" ?
>
> options (prompt="; ", continue=";; ")
>
> does the trick.
> This trick is applicable to shell prompts as well, and that's how I came across
> it, looking at a colleague's screen.
>
> andreas krause
>
>
> --
> Dr. Andreas Krause, GeneData AG, Postfach 254, CH-4016 Basel
> mailto:Andreas.Krause@genedata.com http://www.genedata.com
> -----------------------------------------------------------------------
> This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
> send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
> message: unsubscribe s-news
>

--
Jens Oehlschlaegel-Akiyoshi
Psychologist/Statistician

CURRENT ADDRESS (until 12/98) | PERMANENT VIRTUAL ADDRESS ------------------------------------------------------------------------ | http://www.geocities.com/Tokyo/Bay/5663/ oehl@psyres-stuttgart.de | oehl@geocities.com +49 711 6781-408 (phone) | +49 711 6876902 (fax) |

Center for Psychotherapy Research | Christian-Belser-Strasse 79a | D-70597 Stuttgart Germany |

(general disclaimer)

----------------------------------------------------------------------- This message was distributed by s-news@wubios.wustl.edu. To unsubscribe send e-mail to s-news-request@wubios.wustl.edu with the BODY of the message: unsubscribe s-news