From ripley at stats.ox.ac.uk  Wed Aug 18 13:56:35 2004
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Wed Aug 18 13:56:41 2004
Subject: [Rd] checkS3methods() change
In-Reply-To: <16673.56337.900481.260563@mithrandir.hornik.net>
Message-ID: <Pine.LNX.4.44.0408181250230.24684-100000@gannet.stats>

On Tue, 17 Aug 2004, Kurt Hornik wrote:

> >>>>> James Wettenhall writes:
> 
> > Hi,
> > I'm using rw2000dev.exe (Win32) built on August 14.
> 
> > If this isn't already planned, can I suggest that when
> > checkS3methods() (called by R CMD check) fails because of
> > a syntax error in a dependent package listed in the DESCRIPTION
> > file of the main package being checked, it would be nice if
> > checkS3methods() reported which dependent package caused it to
> > fail?
> 
> > Running R CMD check on my package limmaGUI, revealed a syntax
> > error in one of limmaGUI's dependent packages, which turned out
> > to be the R2HTML package (after a bit of sleuthing).
> 
> > Here's the syntax error in R2HTML, caused by the new parsing
> > rules for associative use of relational operators:
> 
> >   x0 <- xm[okP] == 0 != (as.numeric(Cf[okP]) == 0)
> 
> > The R2HTML package (version 1.3) was installed with:
> >> install.packages("R2HTML")
> > trying URL `http://cran.r-project.org/bin/windows/contrib/2.0/PACKAGES'
> 
> > Here's the tail of the R CMD check output for limmaGUI:
> 
> > * checking R files for syntax errors ... OK
> > * checking R files for library.dynam ... OK
> > * checking S3 generic/method consistency ... WARNING
> > Error in .try_quietly({ : Error in parse(file, n, text, prompt) : syntax error on line 446
> > Execution halted
> > See section 'Generic functions and methods' of the 'Writing R Extensions' manual.
> > * checking replacement functions ... WARNING
> > Error in .try_quietly({ : Error in parse(file, n, text, prompt) : syntax error on line 446
> > Execution halted
> > In R, the argument of a replacement function which corresponds
> > to the right hand side must be named 'value'.
> > * checking foreign function calls ... WARNING
> > Error in .try_quietly({ : Error in parse(file, n, text, prompt) : syntax error on line 446
> > Execution halted
> > See section 'System and foreign language interfaces' of the
> > 'Writing R Extensions' manual.
> > * checking Rd files ... OK
> > * checking for missing documentation entries ... ERROR
> > Error in .try_quietly({ : Error in parse(file, n, text, prompt) :
> > * syntax error on line 446
> 
> I am trying to find a general way of printing a suitable traceback
> alongside .try_quietly() errors.  Turns out to be sort of tricky,
> unfortunately ...

In this particular case it is a problem with library() not giving the 
information (or just saying `this package' in others).  I am trying 
systematically to improve the error messages, so it now gives

Error in parse(file, n, text, prompt) : syntax error on line 446
Error: Unable to load R code in package 'R2HTML'

for example.  And that's because I keep getting errors myself with no 
traceback.

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595


[Rd] checkS3methods() change
Prof Brian Ripley