Skip to content

trace an Rd conversion error in R cmd check

9 messages · Duncan Murdoch, Brian Ripley, Spencer Graves +3 more

#
Hi All,

Apologies if this is a very naive question.  Is there a way to see the
particular Rd file being processed right before a warning/error
occurs?  As far as I can tell, all my .Rd files use have names and
titles and they are unique between Rd files (sometimes in a file I use
something like \name{foo} \title{Foo}).  I seem to be able to convert
files to latex using: R CMD Rdconv --type=latex on all my Rd files
without problems.

Here is the warning and error:

* checking PDF version of manual ... ERROR
Rd conversion errors:
Warning in file(con, "r") :
  file("") only supports open = "w+" and open = "w+b": using the former
Error : : Sections \title, and \name must exist and be unique in Rd files

I am using:

R Under development (unstable) (2011-10-11 r57214)
Platform: x86_64-pc-mingw32/x64 (64-bit)
on Windows 7 with Rtools 2.14 and MikTeX 2.9

Any suggestions or pointers to manuals/documentation would be greatly
appreciated.

Thanks,

Josh
#
On 11-10-12 3:24 AM, Joshua Wiley wrote:
It does normally list the name.  In your case, that appears to be "", 
based on the warning.

I don't know how this would come about (I don't believe "" is a legal 
filename in Windows).

If you could make a copy of the package available, I might be able to 
track this down.

Duncan Murdoch
#
R CMD check is R code: you can run the R code for yourself using R's 
debugging facilities.  In this case start with 'R CMD Rd2pdf pkg-name' 
(which should give the same error, as that is what R CMD check calls), 
then run that R code directly (there are comments in the code in 
R-devel about how to do so).
On Wed, 12 Oct 2011, Joshua Wiley wrote:

            
This is far too rare a problem to be documented in detail.

  
    
#
Thanks to Drs. Murdoch and Ripley for your fast and helpful replies.
I did not realize that R CMD check was R code, so that was incredibly
useful.

I spent the morning working on debugging this, and I think I must have
messed up setting up the Windows tool chain, because I get the error
even when running R CMD check on other packages (e.g., MASS).  I am
still not sure what exactly I am missing/setup incorrectly.  R
compiled from source and passed make check all without any trouble.  I
can install packages, and I can make PDFs using tools:::..Rd2pdf, but
when I try to use Rd2pdf on a package instead of specific files I get
the error.

Looking at the R code for CMD check helped me better understand the
process and I will just work with my tool chain until I get things
working.

Thanks again!

Josh



On Wed, Oct 12, 2011 at 4:10 AM, Prof Brian Ripley
<ripley at stats.ox.ac.uk> wrote:

  
    
#
Hi, Josh:


       Have you had a recent version that passed "R CMD check"?  If yes, 
I suggest you save your recent changes then revert to that earlier 
version and add your recent changes back in again one at a time.  I've 
done that many times.  (It's also a major reason I make changes as small 
as I can and run "R CMD check" after each one.  Then if I get something 
like this I can't figure out, there aren't many changes to scan through 
to find the problem.)


       Hope this helps.
       Spencer
On 10/12/2011 4:10 AM, Prof Brian Ripley wrote:

  
    
#
Good luck in tracking down the problem.  I won't give
any help there.

I've seen this sort of error message (or worse) when using
system.file() and the desired file didn't exist.  If that
is the problem, add the newish argument mustWork=TRUE to
the call to system.file so you get an error message from system.file
instead of a warning or inappropriate behavior from the function
that is confused by the "" that system.file() returns when the
desired file doesn't exist.

  > con <- file(system.file(package="base", "noSuchFile"), "r")
  Warning message:
  In file(system.file(package = "base", "noSuchFile"), "r") :
    file("") only supports open = "w+" and open = "w+b": using the former
  > con <- file(system.file(package="base", "noSuchFile", mustWork=TRUE), "r")
  Error in system.file(package = "base", "noSuchFile", mustWork = TRUE) : 
    no file found

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com
#
Hi Spencer,

Yes, I have versions that pass, but it is not package specific (i.e.,
I can download other package sources from CRAN and if I run R CMD
check on them, I get the same error).  When I run R CMD check using R
2.13.1 or R 2.13.2 it is fine.  Using either:

compiled from source:
R Under development (unstable) (2011-10-12 r57226)
Platform: x86_64-pc-mingw32/x64 (64-bit)

pre-built binary:
R Under development (unstable) (2011-10-10 r57203)
Platform: x86_64-pc-mingw32/x64 (64-bit)

I get the file error.  I am going to keep poking around and try Bill's
suggestion adding mustWork=TRUE.

Cheers,

Josh

On Wed, Oct 12, 2011 at 10:12 AM, Spencer Graves
<spencer.graves at prodsyse.com> wrote:

  
    
3 days later
#
Hi.
On Wed, Oct 12, 2011 at 9:24 AM, Joshua Wiley <jwiley.psych at gmail.com> wrote:
For what it is worth: I also get this error when I try to "R CMD
check" any of my many packages on R Under development (unstable)
(2011-10-13 r57231) on Windows 7.  It does not occur with R version
2.14.0 alpha (2011-10-14 r57245).  I haven't had time to troubleshoot
this and I figured I'll wait a few revisions.

The error does not occur when using tools::checkRd(), e.g.
/Henrik
5 days later
#
To close this thread, this issue appears to have been solved in R
devel since at least r57339 (also confirmed with r57348).

/Henrik
On Sun, Oct 16, 2011 at 5:58 AM, Henrik Bengtsson <hb at biostat.ucsf.edu> wrote: