0

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) {
     ...
}
der_grund
  • 1,898
  • 20
  • 36
  • Did you check if the function is mentioned in the namespace file? – phiver Mar 12 '18 at 10:53
  • First 4 lines from NAMESPACE: `# Generated by roxygen2: do not edit by hand export(create_var_details) export(create_var_overview)` – der_grund Mar 12 '18 at 12:03
  • Did you have a look ath [this](https://stackoverflow.com/questions/49233040/r-package-adding-a-vignette-causes-undefined-exports?noredirect=1#comment85472553_49233040) or [this](https://stackoverflow.com/questions/35424683/r-cmd-check-fails-with-undefined-exports)? – phiver Mar 12 '18 at 12:13
  • 1
    Regarding the second link: My `.Rbuildignore`: `^.*\.Rproj$ ^\.Rproj\.user$` The first link leads to this question. – der_grund Mar 12 '18 at 12:26
  • sorry first link should have been [this one](https://stackoverflow.com/questions/26697727/what-does-error-in-namespaceexportns-exports-undefined-exports-mean) – phiver Mar 12 '18 at 12:31
  • Thanks. But I also do not try to create common help files. Neither do I have any suspicious comments in the functions... – der_grund Mar 12 '18 at 12:41

0 Answers0