[R] Why do i get "Error: unexpected input in "A<-lm(GandW ~ Authocracy, Data)"

David Winsemius dwinsemius at comcast.net
Sun Nov 25 21:59:04 CET 2012


On Nov 25, 2012, at 7:16 AM, Barry Rowlingson wrote:

> On Sun, Nov 25, 2012 at 2:01 PM, Rui Barradas <ruipbarradas at sapo.pt>  
> wrote:
>> Hello,
>>
>> Another possibility is to use argument 'data' explicitly:
>>
>> A<-lm(GandW ~ Authocracy, data = Data)
>>
>>
>> Hope this helps,
>
> It's not going to. The line parses very nicely as written, with or
> without naming the argument.
>
> The specific error the poster was getting only happens when you have
> an input that doesn't parse. I have been having trouble reproducing
> that error message but finally managed it by using that weird 'hook'
> character in the top-left of my keyboard:
>
>> z¬1
> Error: unexpected input in "z?"
>
> - which makes me think the link I pointed to about Macs mashing <-
> into a single arrow character is the kind of thing that is happening.

I didn't see such behavior here and have never observed it in my use  
of a Mac.  If you remove the non-printing "¬" characters coming from  
ill-behaved editors on other OSes using text editor, generally things  
will proceed normally.

>
> We wait....

I suppose we do, but in my experience, that problem on a Mac arises  
from copy-pasting from web postings from PC sources. Some of the  
problem characters such as the "¬" from the IBM end-of-line heritage  
are non-printing on the Mac console. (Do they print on the Linux  
consoles?. I use Text Wrangler which has a handy ZapGremlins menu  
choice.

--

David Winsemius, MD
Alameda, CA, USA




More information about the R-help mailing list