[R] Error with Source()

Duncan Murdoch murdoch.duncan at gmail.com
Fri Nov 11 10:31:52 CET 2011


On 11-11-10 9:25 AM, ftonini wrote:
> Hi everybody,
>
> I started to receive a weird message in R that I have never seen
> before...also I haven't found anything on google or on this forum about it.
> Whenever I use the command source(...) to point to one of my scripts, I get
> the following message:
>
> Error in source("myfunctions.R") : myfunctions.R:884:9: unexpected symbol
> 883:
> 884:         cond
>               ^
>
> I am using the same commands as I did in the past and it was working...I
> started to receive this error (not sure if it has to do with it or not)
> after trying to create a batch file to run one of my .R scripts with
> double-click. That batch file worked...but as soon as I use the source()
> command it does not work any more.
>
> Any help is appreciated!

The message indicates that on line 884 of that script, the parser is 
finding a syntax error.  A common way to generate that error is to fail 
to close parentheses, e.g.

( a
cond

gives a similar one.

Duncan Murdoch



More information about the R-help mailing list