Alex Rivera | Logout

Can I have R vignette with a pre-compiled PDF with manual index.html show up the vignette list?

Asked 2012-10-29T20:12:21.883
14

I want to include a pre-compiled PDF as a vignette in a R package. The PDF is not generated via Sweave. Without a .Rnw to process, there is no \VignetteIndexEntry to cause the usual automatic generation of index.html and Meta/vignette.rds.

I created an index.html in inst/doc that is copied into doc during installation. This is corrected linked from the main package help page. However, when I load the package and execute browseVignettes("MyPackage"), I get

No vignettes found by browseVignettes("MyPackage")

This makes sense, because R apparently has no way to know that the package has a vignette. The installed package has no Meta/vignette.rds file. Can I somehow get my PDF to appear with browseVignettes()?

pdfpages

I'm familiar with the approach taken by the mosaic package, which is to use pdfpages to include the entire PDF. While clever, I feel like there should be a better way that avoids the proliferation of files.

Edit
Report

1 Answer

2

R definitely needs a better way to deal with vignettes: http://comments.gmane.org/gmane.comp.lang.r.devel/31967 Before my proposal is approved and implemented, we still have to live with the dark voodoo of Makefile. For example, you can put a fake.Rnw and a real.pdf under inst/doc, and mv real.pdf fake.pdf in the Makefile. In fake.Rnw, you just follow the rule of \VignetteIndexEntry{}.

answered 2012-10-29T20:28:41.417

Your Answer