[R-pkg-devel] R CMD check works but with devtools::check() examples fail

Jack O. Wasey j@ck @end|ng |rom j@ckw@@ey@com
Thu May 16 11:56:40 CEST 2019


Barbara,

On 5/15/19 5:09 PM, Barbara Lerner wrote:
> I have just upgraded to R 3.6.0 and when building and checking my
> package, R CMD check passes all the checks, including running the
> examples, but devtools::check reports a failure when running the
> examples.  I have also run the example successfully manually in RStudio.
> I would appreciate help in understanding what devtools::check is doing
> that R CMD check is not doing, or help in understanding the failure
> report that devtools::check provides.
> 
> Here are somewhat abbreviated outputs from each:
> 
> 
> ~/git/rdtLite.check/rdtLite.Rcheck/00_pkg_src/rdtLite -> R CMD check .

Agree with Dirk, and also you are running R CMD check on the current 
directory, whereas Writing R Extensions recommends/insists on checking a 
tarball created using R CMD build:

"It is strongly recommended that the final checks are run on a tar 
archive prepared by R CMD build."

I've no idea how this might change checks (does it still look at 
.Rbuildignore?) but this might introduce additional problems.

Jack


> * using log directory
> ‘/Users/blerner/git/rdtLite.check/rdtLite.Rcheck/00_pkg_src/rdtLite/..Rcheck’
> * using R version 3.6.0 (2019-04-26)
> * using platform: x86_64-apple-darwin15.6.0 (64-bit)
> * using session charset: UTF-8
> * checking for file ‘./DESCRIPTION’ ... OK
> * this is package ‘rdtLite’ version ‘1.0.3’
> * checking package namespace information ... OK
> * checking package dependencies ... OK
> * checking if this is a source package ... OK
> * checking if there is a namespace ... OK
> * checking for executable files ... OK
> * checking for hidden files and directories ... NOTE
> Found the following hidden files and directories:
>     .commit
>     ..Rcheck
> These were most likely included in error. See section ‘Package
> structure’ in the ‘Writing R Extensions’ manual.
> * checking for portable file names ... OK
> * checking for sufficient/correct file permissions ... OK
> * checking whether package ‘rdtLite’ can be installed ... OK
> * checking installed package size ... OK
> * checking package directory ... OK
> * checking DESCRIPTION meta-information ... OK
> * checking top-level files ... OK
> * checking for left-over files ... OK
> * checking index information ... OK
> * checking package subdirectories ... WARNING
> Found the following directory with the name of a check directory:
>     ./..Rcheck
> Most likely, these were included erroneously.
> * checking R files for non-ASCII characters ... OK
> * checking R files for syntax errors ... OK
> * checking whether the package can be loaded ... OK
> * checking whether the package can be loaded with stated dependencies ... OK
> * checking whether the package can be unloaded cleanly ... OK
> * checking whether the namespace can be loaded with stated dependencies
> ... OK
> * checking whether the namespace can be unloaded cleanly ... OK
> * checking dependencies in R code ... NOTE
> Namespace in Imports field not imported from: ‘gtools’
>     All declared Imports should be used.
> * checking S3 generic/method consistency ... OK
> * checking replacement functions ... OK
> * checking foreign function calls ... OK
> * checking R code for possible problems ... OK
> * checking Rd files ... OK
> * checking Rd metadata ... OK
> * checking Rd cross-references ... OK
> * checking for missing documentation entries ... OK
> * checking for code/documentation mismatches ... OK
> * checking Rd \usage sections ... OK
> * checking Rd contents ... OK
> * checking for unstated dependencies in examples ... OK
> * checking examples ... OK
> * checking for unstated dependencies in ‘tests’ ... OK
> * checking tests ...
>     Running ‘test-all.R’
>    OK
> * checking PDF version of manual ... OK
> * DONE
> 
> Status: 1 WARNING, 2 NOTEs
> 
> 
> 
> ~/git/rdtLite.check/rdtLite.Rcheck/00_pkg_src/rdtLite -> Rscript -e
> "devtools::check()"
> Updating rdtLite documentation
> Warning: roxygen2 requires Encoding: UTF-8
> Writing NAMESPACE
> Loading rdtLite
> Registered S3 methods overwritten by 'ggplot2':
>     method         from
>     [.quosures     rlang
>     c.quosures     rlang
>     print.quosures rlang
> Writing NAMESPACE
> ── Building ─────────────────────────────────────────────────────────
> rdtLite ──
> Setting env vars:
> ● CFLAGS    : -Wall -pedantic -fdiagnostics-color=always
> ● CXXFLAGS  : -Wall -pedantic -fdiagnostics-color=always
> ● CXX11FLAGS: -Wall -pedantic -fdiagnostics-color=always
> ────────────────────────────────────────────────────────────────────────────────
>      checking for file
> ‘/Users/blerner/git/rdtLite.check/rdtLite.Rcheck/00_pkg_src✔  checking
> for file
> ‘/Users/blerner/git/rdtLite.check/rdtLite.Rcheck/00_pkg_src/rdtLite/DESCRIPTION’
> ─  preparing ‘rdtLite’:
> ✔  checking DESCRIPTION meta-information ...
> ─  checking for LF line-endings in source and make files and shell scripts
> ─  checking for empty or unneeded directories
> ─  building ‘rdtLite_1.0.3.tar.gz’
> 
> ── Checking ─────────────────────────────────────────────────────────
> rdtLite ──
> Setting env vars:
> ● _R_CHECK_CRAN_INCOMING_REMOTE_: FALSE
> ● _R_CHECK_CRAN_INCOMING_       : FALSE
> ● _R_CHECK_FORCE_SUGGESTS_      : FALSE
> ── R CMD check
> ─────────────────────────────────────────────────────────────────
> ─  using log directory
> ‘/private/var/folders/66/3lfdj29j1wb48v_s298qtbwm0000gn/T/Rtmpln2xE0/rdtLite.Rcheck’
> ─  using R version 3.6.0 (2019-04-26)
> ─  using platform: x86_64-apple-darwin15.6.0 (64-bit)
> ─  using session charset: UTF-8
> ─  using options ‘--no-manual --as-cran’
> ✔  checking for file ‘rdtLite/DESCRIPTION’
> ─  this is package ‘rdtLite’ version ‘1.0.3’
> ✔  checking package namespace information ...
> ✔  checking package dependencies (3.1s)
> ✔  checking if this is a source package
> ✔  checking if there is a namespace
> ✔  checking for executable files (439ms)
> N  checking for hidden files and directories
>      Found the following hidden files and directories:
>        .commit
>      These were most likely included in error. See section ‘Package
>      structure’ in the ‘Writing R Extensions’ manual.
> ✔  checking for portable file names
> ✔  checking for sufficient/correct file permissions
> ✔  checking whether package ‘rdtLite’ can be installed (3s)
> ✔  checking installed package size ...
> ✔  checking package directory ...
> ✔  checking for future file timestamps ...
> ✔  checking DESCRIPTION meta-information ...
> ✔  checking top-level files
> ✔  checking for left-over files
> ✔  checking index information
> ✔  checking package subdirectories ...
> ✔  checking R files for non-ASCII characters ...
> ✔  checking R files for syntax errors ...
> ✔  checking whether the package can be loaded ...
> ✔  checking whether the package can be loaded with stated dependencies ...
> ✔  checking whether the package can be unloaded cleanly ...
> ✔  checking whether the namespace can be loaded with stated dependencies ...
> ✔  checking whether the namespace can be unloaded cleanly ...
> ✔  checking dependencies in R code (800ms)
> ✔  checking S3 generic/method consistency (760ms)
> ✔  checking replacement functions ...
> ✔  checking foreign function calls (437ms)
> ✔  checking R code for possible problems (5.5s)
> ✔  checking Rd files ...
> ✔  checking Rd metadata ...
> ✔  checking Rd line widths ...
> ✔  checking Rd cross-references ...
> ✔  checking for missing documentation entries ...
> ✔  checking for code/documentation mismatches (563ms)
> ✔  checking Rd \usage sections (879ms)
> ✔  checking Rd contents ...
> ✔  checking for unstated dependencies in examples ...
> E  checking examples (2s)
>      Running examples in ‘rdtLite-Ex.R’ failed
>      The error most likely occurred in:
> 
>      > base::assign(".ptime", proc.time(), pos = "CheckExEnv")
>      > ### Name: prov.json
>      > ### Title: Provenance Access Functions
>      > ### Aliases: prov.json prov.dir prov.visualize prov.summarize
>      >
>      > ### ** Examples
>      >
>      > prov.init()
>      > a <- 1
>       ----------- FAILURE REPORT --------------
>       --- failure: length > 1 in coercion to logical ---
>       --- srcref ---
>      :
>       --- package (from environment) ---
>      rdtLite
>       --- call from context ---
>      .ddg.proc.node("Operation", cmd using abbrev, cmd using abbrev, functions.called
> = cmd using functions.called,
>          cmd = cmd)
>       --- call from argument ---
>      !is.null(functions.called) && !is.na(functions.called)
>       --- R stacktrace ---
>      where 1: .ddg.proc.node("Operation", cmd using abbrev, cmd using abbrev,
> functions.called = cmd using functions.called,
>          cmd = cmd)
>      where 2: .ddg.parse.commands(as.expression(task), environ = .GlobalEnv,
>          run.commands = FALSE)
>      where 3: (function (task, result, success, printed)
>      {
>          .ddg.parse.commands(as.expression(task), environ = .GlobalEnv,
>              run.commands = FALSE)
>          return(TRUE)
>      })(base::quote(a <- 1), 1, TRUE, FALSE)
> 
>       --- value of length: 3 type: logical ---
>      [1] TRUE TRUE TRUE
> 
>     .... more lines omitted ...
> 
>       ----------- END OF FAILURE REPORT --------------
>      Fatal error: length > 1 in coercion to logical
> ✔  checking for unstated dependencies in ‘tests’ ...
> ─  checking tests ...
> ✔  Running ‘test-all.R’ (685ms)
> 
>



More information about the R-package-devel mailing list