R包:添加晕影导致未定义的导出'

时间:2018-03-12 10:32:00

标签: r devtools r-package

我写了一个内部包,当我添加一个插图时,它不再通过devtools:check()。我用devtools::use_vignette("my-vignette")添加了小插图。

即使我没有更改任何关于晕影模板的内容,运行devtools::check()会产生:

==> 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

这里是上面错误中提到的一个函数的例子(函数的内容无关紧要;即使函数为空也会发生同样的错误):

#' 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) {
     ...
}

0 个答案:

没有答案