From kasperdanielhansen at gmail.com  Wed Feb 24 21:05:24 2010
From: kasperdanielhansen at gmail.com (Kasper Daniel Hansen)
Date: Wed, 24 Feb 2010 15:05:24 -0500
Subject: [Rd] build, data and vignettes
Message-ID: <e780c0971002241205t2f5c8e5gb0c3eb3110406a0d@mail.gmail.com>

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



[Rd] build, data and vignettes
Kasper Daniel Hansen