Can't get sample function from "An Introduction to R" to work
On Jul 16, 2005, at 9:58 AM, Thomas Lumley wrote:
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.
I'll put this, as well as the copying/pasting as unformatted text as recommends Spencer, into my bag of tricks.
If you actually typed into the R console then this won't explain it, of course.
And indeed, I did type right into the R console, so the mystery remains... Thanks, David
-thomas