[Rd] build, data and vignettes

Kasper Daniel Hansen kasperdanielhansen at gmail.com
Wed Feb 24 21:05:24 CET 2010


Based on some testing it seems to me that if I have a package with
  a dataset in /data
  a Sweave vignette in inst/doc (but no associated pdf file)
  the vignette loads the data in /data through
     data(dataset)
and I do a
  R CMD build
R will try to build the pdf version of the vignette, but will be
unable to find the dataset in data because the package is not yet
installed.  However, if I do
  R CMD build --no-vignettes PKGNAME
  R CMD check PKGNAME_VERSION.tar.gz
the package passes R CMD check! Presumably because R CMD check
installs the package first.

This took me a long time to track down (inspired by a recent addition
of dataset to the Bioconductor package Genominator and a subsequent
failed build - specifically the dataset yeastAnno.sources and the
vignette withShortRead.Rnw).  I am using lazy loading (in case it
matters, which I don't think it does).

It seems like the relevant fix is to include pdf versions of the
vignette(s) in inst/doc.

On one hand I can see why the build fails.  And the fix is easy.  But
just thought I would mention it.

Kasper



More information about the R-devel mailing list