Problem
I created a small internal package for my company. To describe hot to use it, I wrote a vignette. But for some reason, the vignette is not built when I hit Install and Restart in RStudio.
Further Information
I use roxygen for the package documentation
Interestingly, the output from Install and Restart says that it is installed:
==> devtools::document(roclets=c('rd', 'collate', 'namespace')) Updating DataReportR documentation Loading DataReportR Documentation completed ==> Rcmd.exe INSTALL --no-multiarch --with-keep.source DataReportR * installing to library 'C:/Program Files/R/library' * installing *source* package 'DataReportR' ... ** R ** preparing package for lazy loading ** help *** installing help indices ** building package indices ** installing vignettes ** testing if installed package can be loaded * DONE (DataReportR)
devtools::build_vignettes()
returnsNULL
even though the linesSuggests: knitr, rmarkdown VignetteBuilder: knitr
are included in the DESCRIPTION.
The YAML header of the vignette looks like this:
--- title: "My title" output: rmarkdown::html_vignette vignette: > %\VignetteIndexEntry{Generate LaTeX tables for Data Reports} %\VignetteEngine{rmarkdown::render} %\usepackage[utf8]{inputenc} ---
I also tried to force building the vignette by
devtools::build(vignettes = TRUE)
but nothing changed.
EDIT (changed YAML header):
When I change %\VignetteEngine{rmarkdown::render}
to %\VignetteEngine{knitr::rmarkdown}
in the vignette's YAML header, devtools::build_vignettes()
works and places the built vignette in /inst/doc/
.
However, when I Check the package in RStudio, the check fails at this position:
** installing vignettes
** testing if installed package can be loaded
Error in namespaceExport(ns, exports) :
undefined exports: create_var_details, create_var_overview
Error: loading failed
Execution halted
ERROR: loading failed
Both create_var_details
and create_var_overview
are exported functions. Here an example:
...
#' @export
#'
create_var_details <- function(...
...
With the old header, the checks were fine.