Skip to content
Prev 70088 / 398503 Next

attached file with syntax error

Eric Lecoutre wrote:
You may not be able to, but I can!

 > x=c(0,1,)
 > x
[1] 0 1

( R 2.0.1 and R 1.8.1 )

  I suspect the error is more to do with the length of the line 
overflowing a buffer, so that R doesn't see the closing parenthesis, and 
then the next line starts with 'x=' (or whatever variable name) so the 
parser sees:

  a = c(1,1,1,
  b = c(1,0,1,1,1,1)

and hence syntax error.

I pasted the long line in interactive mode, and R prompted me for a 
continuation with a '+' prompt, even though there was a closing 
parenthesis on the long line. That made me think it had truncated the 
input.

Further tests reveals the input line is chopped at roughly 1022 
characters, which makes me think theres a buffer[1024] somewhere. Its 
probably documented as well.

Baz