[Bioc-devel] not including vignette in R CMD check
On 06/20/2012 12:46 PM, Kasper Daniel Hansen wrote:
I have a package (to be submitted) with two "vignettes". One is a user guide with quick examples, and should be checked as part of R CMD check. The other contains a runable longer analysis and I would like to exclude it from the daily R CMD build due to length and resource demands. But it is in principle still runable on a bigger system. I want to include the Rnw file and I want the pdf to be indexed. What is the preferred way for doing this, these days? I know Wolfgang has an old solution in tilingArray, but I was wondering if there is a better way now.
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
Kasper
_______________________________________________ Bioc-devel at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/bioc-devel
Computational Biology / Fred Hutchinson Cancer Research Center 1100 Fairview Ave. N. PO Box 19024 Seattle, WA 98109 Location: Arnold Building M1 B861 Phone: (206) 667-2793