[R] R CMD check detects parse error, but in which file?

Jim Lemon jim at bitwrit.com.au
Wed Mar 4 12:18:54 CET 2009


Matthieu Stigler wrote:
> Hello
>
> I looked on the archives but did not find answer for that...
>
> Running R CMD check for a package, i get an error:
>
> Error in parse(n = -1, file = file) : unexpected symbol at
> 3341: }
>
> But how can I find which file is guilty? What is this 3342 referring to?
>
> Finally the solution I found is to source() every file until I find 
> the file where the problem is... Is there some better way to do it? 
> With a debuger? thanks a lot!
>
Hi Matthieu,
My understanding (and I may get clipped up alongside the head if I'm 
wrong) is that R concatenates all the source code into one big file hen 
checking and the number is the line number in that file. The error 
message may mean that you have an extra right parenthesis in that line 
(or very near to).


Jim




More information about the R-help mailing list