Skip to content
Prev 3444 / 21312 Next

[Bioc-devel] not including vignette in R CMD check

On 06/20/2012 12:46 PM, Kasper Daniel Hansen wrote:
Hi Kapser -- two suggestions

The first is a variant of Wolfgang's approach -- include the Rnw files 
for big and small, and the pdf file for big in vignettes/. Both Rnw 
files have \VignetteIndexEntry.

$ tree vig
vig
??? DESCRIPTION
??? NAMESPACE
??? vignettes
     ??? big.pdf
     ??? big.Rnw
     ??? Makefile
     ??? small.Rnw

Write a Makefile that compiles only small

$ cat vig/vignettes/Makefile
all: small.pdf

%.tex: %.Rnw
	"$(R_HOME)/bin/R" CMD Sweave $^

%.pdf: %.tex
	texi2dvi --pdf --clean $^

clean:
	rm -f *tex

(evaluate from the command line, e.g., for testing, with R CMD make). 
Build the package with R CMD build vig, and inspect the result

$ tar tzf vig_1.0.tar.gz
vig/
vig/inst/
vig/inst/doc/
vig/inst/doc/small.Rnw
vig/inst/doc/big.pdf
vig/inst/doc/small.pdf
vig/inst/doc/big.Rnw
vig/vignettes/
vig/vignettes/Makefile
vig/vignettes/small.Rnw
vig/vignettes/big.Rnw
vig/NAMESPACE
vig/DESCRIPTION

big and small are both indexed, e.g., by vignette(package="vig") or 
browseVignettes() or on package html help page; the .R source is 
available for both big and small.

A second approach is to manually create an inst/doc/index.html, which is 
then available on the package html help page (though vignettes aren't 
discoverable through other means, like vignette() / browseVignette()).

Martin