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

From: Uwe Ligges <ligges_at_statistik.tu-dortmund.de>
Date: Wed, 04 Mar 2009 11:33:12 +0100

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?

Given I remember correctly without looking into the details: It is the line number in the concatenated file (of all your .R files, by default sorted in a C locale).

> Finally the solution I found is to source() every file until I find the

Yes, this is probably the quickest way. source() them using a loop that reports which one fails.

You may want to try out R-devel which tells you which of your R files is the culprit.

Uwe Ligges

> file where the problem is... Is there some better way to do it? With a
> debuger? thanks a lot!
>
> Matthieu Stigler
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Wed 04 Mar 2009 - 09:35:15 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 04 Mar 2009 - 10:30:24 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive