[R] use of split lines in ess

Douglas Bates bates at stat.wisc.edu
Tue Mar 9 18:36:32 CET 2004


"David Andel" <andel at ifi.unizh.ch> writes:

> I am very astonished that R generates a "syntax error" when I want to
> split up a line with a backslash, which usually works in any shell
> script.

One way to diminish the astonishment factor when using software is to
try reading the documentation. :-)

The backslash in part of the R syntax (except within quoted strings)
so it generates a syntax error.

If you want to force continuation of an expression to the next input
line then ensure that the partial expression that you type is not
syntactically complete.  Often you can use { or ( on the first line
with the pairing } or ) on the last line.

> R itself generates the "+" symbols at the beginning of following lines
> in a splitted line so I've tried with them as well, but also without
> success.

> Searching in the h-help archive did not reveal any answer either.

> How is this accomplished?




More information about the R-help mailing list