[R] Can't get sample function from "An Introduction to R" to work

Thomas Lumley tlumley at u.washington.edu
Sat Jul 16 16:58:45 CEST 2005

On Fri, 15 Jul 2005, David Groos wrote:

> Thank you-all very much for your help, your responses and help has been
> very encouraging.  The following doesn't close the case but it tables
> it...
> First I copied Ken's code into my R Console and...it worked great!
> That was baffling as it looked identical to mine.
> I did not explicitly say earlier that the code I sent out I had copied
> from the console, pasted into MS Word, changed font size, then pasted
> it into the e-mail--in other words, that was a copy of one of the codes
> that didn't work.

Mysterious syntax errors on OS X can result from copying and pasting into 
R. Files that look perfectly innocent can contain Windows line endings 
(\r\n) or en-dashes instead of hyphens.  These might well be transparently 
fixed in the process of converting to email.

If you actually typed into the R console then this won't explain it, of 


More information about the R-help mailing list