Re: [R] attached file with syntax error

From: Barry Rowlingson <>
Date: Fri 20 May 2005 - 21:55:25 EST

Eric Lecoutre wrote:
> Well...
> You just can't end vector declaration with a comma...

>>x <- c(0,1,)

> Error: syntax error
>>x <- c(0,1)

  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 mailing list PLEASE do read the posting guide! Received on Fri May 20 22:26:26 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:56 EST