[R] Unreasonable syntax error

Bill.Venables at csiro.au Bill.Venables at csiro.au
Tue Jun 21 00:47:49 CEST 2011


The advice is always NOT to use Microsoft Word to edit an R file.  That stuff is poisonous.  Microsoft word, typical of all Microsoft software, does not do what you tell it to do but helpfully does what it thinks you meant to ask it to do but were too dumb to do so.

Even notepad, gawdelpus, would be better.

When I look at your script the first sign of trouble I see is:

Error: unexpected input in:
"     s[1,3,k]<- (0.1) * runif(1)+ 0.1; 
     s[1,1,k]<- (0.02) *  runif(1)+ 0.98 ¨"

which is the spurious character Microsoft word has helpfully inserted to make it all look nice.  It's downhill all the way from there.

(R does not expect Microsoft Word, just as "nobody expects the Spanish Inquisition".  See http://www.youtube.com/watch?v=CSe38dzJYkY).

Bill Venables.

 
 

-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of james198877
Sent: Tuesday, 21 June 2011 7:13 AM
To: r-help at r-project.org
Subject: [R] Unreasonable syntax error

http://r.789695.n4.nabble.com/file/n3612530/PSC.r PSC.r 

Hi all,

I just wrote a program in R by editing it in Microsoft Word and then pasting
into the text editor of R. The above is the file.

And below is what the console complains.... Why doesn't it recognise 'r'??

I have to mention that at least when I typed this first several lines into
the console, the first error didn't appear. I don't try the next errors as
there would be too many lines to type...I'm not sure if this is something
about Word

http://r.789695.n4.nabble.com/file/n3612530/lastsave.txt lastsave.txt 

Thanks a lot for your help!!!

--
View this message in context: http://r.789695.n4.nabble.com/Unreasonable-syntax-error-tp3612530p3612530.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list