vignette

Enforce PDF package vignette with knitr

假装没事ソ 提交于 2019-12-01 16:06:09
问题 I have a vignette for my package which compiles to a nice PDF when compiled with Rscript -e 'rmarkdown::render("tmod.rmd")' . However, when I compile and install the package, start R and type vignette("mypackagename") , a browser window opens with ugly looking HTML, without a title, without a table of contents and without references. However, if I compile the vignette manually to pdf before creating the package, it shows up just fine. What went wrong? Why is my PDF not generated automatically

Knitr: R package check error, object 'opts_chunk' not found

大憨熊 提交于 2019-12-01 13:45:55
问题 I am getting the following error when checking my R package > Error: could not find function "locdata" > Execution halted > when running code in ‘DFSurvey.Rnw’ > ... > > > opts_chunk$set(cache = TRUE, fig.path = "DFSurveyImages/", dev = "pdf") > > When sourcing ‘DFSurvey.R’: > Error: object 'opts_chunk' not found > Execution halted Yihui Xie (knitr developer) said that was because in RStudio, knitr was not set as the method for weaving .Rnw files, https://groups.google.com/forum/?fromgroups#

How do I 'prebuild' a vignette index for an R package?

好久不见. 提交于 2019-11-30 22:44:16
问题 I'm preparing a package for submission to CRAN. I use R CMD build myPackage then R CMD check myPackage --as-cran and it passes all checks with no notes or warnings. However, each time I try to submit, I get the following error message from one of the CRAN maintainers: Package has a VignetteBuilder field but no prebuilt vignette index. As a start, I'd like to be able to reproduce the above error message on my own system ( R version 3.0.1 ). The vignette .Rnw file looks like this: %