Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using a static (prebuilt) PDF vignette in R package

Tags:

What is the proper way, to include a static PDF file as a "vignette" in a CRAN package as of R 3.0?

The trick described in this document of using an empty stub Rnw does not seem to work in R 3.0. The document suggests that there is now a better way based on \VignetteEngine{} but it's not quite clear how this works for static PDF files.

like image 200
Jeroen Ooms Avatar asked Oct 31 '13 20:10

Jeroen Ooms


1 Answers

With R.rsp (>= 1.19.0) you can include a static PDF 'vignettes/main.pdf' by adding a tiny 'vignettes/main.pdf.asis' text file that contains:

%\VignetteIndexEntry{My amazing package} %\VignetteEngine{R.rsp::asis} 

and make sure to have:

Suggests: R.rsp VignetteBuilder: R.rsp 

in your package's DESCRIPTION file. This also works for static HTML vignettes. This is also explained in one of the R.rsp vignettes.

like image 62
HenrikB Avatar answered Jan 10 '23 02:01

HenrikB