R package: Adding a vignette causes 'undefined exports'

左心房为你撑大大i 提交于 2019-12-11 15:23:50

问题


I wrote an internal package and when I add a vignette, it does not pass devtools:check() anymore. I added the vignette with devtools::use_vignette("my-vignette").

Even if I do not change anything about the vignette template, running devtools::check() yields:

==> devtools::check()

Updating DataReportR documentation
Loading DataReportR
Setting env vars --------------------------------------------------------------
CFLAGS  : -Wall -pedantic
CXXFLAGS: -Wall -pedantic
Building DataReportR ----------------------------------------------------------
"C:/PROGRA~1/R/bin/x64/R" --no-site-file --no-environ --no-save --no-restore  \
  --quiet CMD build "C:\Daten\svn\R_Pakete\DataReportR" --no-resave-data  \
  --no-manual 

* checking for file 'C:\Daten\svn\R_Pakete\DataReportR/DESCRIPTION' ... OK
* preparing 'DataReportR':
* checking DESCRIPTION meta-information ... OK
* installing the package to build vignettes
      -----------------------------------
* installing *source* package 'DataReportR' ...
** help
*** installing help indices
** building package indices
** 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

Here an example from one of the functions mentioned in the error above (the contents of the function do not matter; the same error occurs even if the function is empty):

#' Create the variable overview section for your data report
#'
#' @param var_details_xlsx character. Path including file name to the xlsx file which contains all variable information.
#' @param tex_file character. Path including file name to the tex file to be created.
#' @param replace logical. Choose 'FALSE' to prevent tex files from beeing replaced.
#'
#' @importFrom readr write_file
#' @importFrom readxl read_xlsx
#' @importFrom dplyr arrange select mutate
#' @importFrom xtable sanitize xtable
#' @importFrom magrittr %>%
#' @importFrom utils capture.output
#'
#' @export
create_var_overview <- function(var_details_xlsx, tex_file, replace = TRUE) {
     ...
}

来源:https://stackoverflow.com/questions/49233040/r-package-adding-a-vignette-causes-undefined-exports

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!