oops, I forgot to attach the example txt file with the syntax error, so I will do it here, can anyone see what the error is with bryansAtLineLevel? -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: r.txt Url: https://stat.ethz.ch/pipermail/r-help/attachments/20050520/c55da2f4/r.txt
attached file with syntax error
7 messages · bry@xdocs.dk, Eric Lecoutre, Barry Rowlingson +4 more
Well... You just can't end vector declaration with a comma...
x <- c(0,1,)
Error: syntax error
x <- c(0,1)
Eric Eric Lecoutre UCL / Institut de Statistique Voie du Roman Pays, 20 1348 Louvain-la-Neuve Belgium tel: (+32)(0)10473050 lecoutre at stat.ucl.ac.be http://www.stat.ucl.ac.be/ISpersonnel/lecoutre If the statistics are boring, then you've got the wrong numbers. -Edward Tufte
-----Original Message----- From: r-help-bounces at stat.math.ethz.ch [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of bry at xdocs.dk Sent: vendredi 20 mai 2005 11:39 To: r-help at stat.math.ethz.ch Subject: [R] attached file with syntax error oops, I forgot to attach the example txt file with the syntax error, so I will do it here, can anyone see what the error is with bryansAtLineLevel?
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
You can in R-2.1.0 Patched: > c(1,) [1] 1 --sundar
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)
Eric Eric Lecoutre UCL / Institut de Statistique Voie du Roman Pays, 20 1348 Louvain-la-Neuve Belgium tel: (+32)(0)10473050 lecoutre at stat.ucl.ac.be http://www.stat.ucl.ac.be/ISpersonnel/lecoutre If the statistics are boring, then you've got the wrong numbers. -Edward Tufte
-----Original Message----- From: r-help-bounces at stat.math.ethz.ch [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of bry at xdocs.dk Sent: vendredi 20 mai 2005 11:39 To: r-help at stat.math.ethz.ch Subject: [R] attached file with syntax error oops, I forgot to attach the example txt file with the syntax error, so I will do it here, can anyone see what the error is with bryansAtLineLevel?
______________________________________________ R-help at stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
On 20-May-05 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)
Eric
Well, maybe some people can't achieve that, but I can:
x<-c(1,2,3,) x
[1] 1 2 3 (on both R-1.8.0 and R-2.1.0beta) Best wishes to all, Ted. -------------------------------------------------------------------- E-Mail: (Ted Harding) <Ted.Harding at nessie.mcc.ac.uk> Fax-to-email: +44 (0)870 094 0861 Date: 20-May-05 Time: 14:07:14 ------------------------------ XFMail ------------------------------
Sundar Dorai-Raj <sundar.dorai-raj at pdf.com> writes:
You can in R-2.1.0 Patched:
> c(1,)
[1] 1 --sundar 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)
I can in versions going back to 1.8.0 (did Eric accidentally include the ">" perhaps?) However, the code in r.txt runs OK on 2.1.0, but bombs on 2.0.1 with
finnsAtLineLevel <- c(0,1,0,1,1,1,1,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0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,1,1,1,1,1,1,1,1,1,0,1,1,1,1,0,0,0,0,1,0,0,0,0,1,0,1,0,1,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,) Error: Object "??" not found Execution halted (Notice irregularity around char #1024). Not quite sure when (or even if!) this got fixed.
O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
It might be worth pointing out that R is supposed to have a 1024 byte (not character) input buffer, and I did fix a few things related to that when internationalizing the parser (and also some about multi-byte pushbacks which I suspect is the issue here). It is still good practice to keep input lines well below that buffer size.
On Fri, 20 May 2005, Peter Dalgaard wrote:
Sundar Dorai-Raj <sundar.dorai-raj at pdf.com> writes:
You can in R-2.1.0 Patched:
c(1,)
[1] 1 --sundar 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)
I can in versions going back to 1.8.0 (did Eric accidentally include the ">" perhaps?) However, the code in r.txt runs OK on 2.1.0, but bombs on 2.0.1 with
finnsAtLineLevel <- c(0,1,0,1,1,1,1,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,00,0,0,0,0,0,0,1,0,0,0,0,0,1,1,0,0,1,1,0,1,1,0,0,1,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,1,0,0,1,0,0,0,1,1,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,1,1,1,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,0,1,0,1,1,1
,1,1,0,1,1,1,1,1,1,1,1,1,1,1,0,0,0+ ,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,0,0,1,0,1,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0,0,1,1,1,1,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,0,0,1,0,1,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,0,0,0,0,1,0,0,0,0,1,0,1,0,1,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,) Error: Object "?" not found Execution halted (Notice irregularity around char #1024). Not quite sure when (or even if!) this got fixed.
Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595