[R] Help with unexpected symbol errors

Jim Lemon jim at bitwrit.com.au
Tue Sep 7 12:04:40 CEST 2010


On 09/07/2010 06:42 AM, Amit Patel wrote:
> Hi
>
> I have got a long script which will not run for me as i keep getting errors :
>
>> source("clusterfixV1_4.r")
> Error in source("clusterfixV1_4.r") :
> clusterfixV1_4.r: unexpected symbol at
> 158: eck[k,2]<- as.numeric(1)
> 159:                   #ClusterInfo[k,2]<- "Clustered
>
> I have sorted all the ones i can but i am having a problem here
> Can anyone tell me the cause of these problems. Its not a very short or
> straightforward script so i dont expect you to go through the whole thing but it
> would be great if you can give me an indication as to what I may be doing wrong.
> I havent attached the data that the script uses because I'm pretty sure the
> principles i have used are right
> when running the script i get the above error on line 158 and 159
> I am more than happy to provide further information(e.g the dataset) if it helps
>
Hi Amit,
Line 159 is a comment, but has unmatched quotes. What happens if you 
delete it? Also, as.numeric(1) looks suspicious. 1 is already numeric. 
Did you mean as.numeric(l)?

Jim



More information about the R-help mailing list