- using R version 4.5.2 Patched (2026-01-31 r89382)
- using platform: x86_64-apple-darwin20
- R was compiled by
Apple clang version 14.0.0 (clang-1400.0.29.202)
GNU Fortran (GCC) 14.2.0
- running under: macOS Ventura 13.3.1
- using session charset: UTF-8
- checking for file ‘mvbutils/DESCRIPTION’ ... OK
- this is package ‘mvbutils’ version ‘2.12.120’
- checking package namespace information ... OK
- checking package dependencies ... INFO
Package suggested but not available for checking: ‘debug’
- 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 ... OK
- checking for portable file names ... OK
- checking for sufficient/correct file permissions ... OK
- checking whether package ‘mvbutils’ can be installed ... [3s/9s] OK
See the install log for details.
- 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 ... OK
- checking code files for non-ASCII characters ... OK
- checking R files for syntax errors ... OK
- checking whether the package can be loaded ... [1s/1s] OK
- checking whether the package can be loaded with stated dependencies ... [0s/1s] OK
- checking whether the package can be unloaded cleanly ... [0s/1s] OK
- checking whether the namespace can be loaded with stated dependencies ... [0s/1s] OK
- checking whether the namespace can be unloaded cleanly ... [1s/1s] OK
- checking loading without being on the library search path ... [1s/1s] OK
- checking whether startup messages can be suppressed ... [1s/1s] OK
- checking dependencies in R code ... OK
- checking S3 generic/method consistency ... OK
- checking replacement functions ... OK
- checking foreign function calls ... OK
- checking R code for possible problems ... [20s/29s] NOTE
cd.load: possible error in mget("tasks", pos = 2, ifnotfound =
list(character(0))): unused argument (pos = 2)
get.cd.from.menu: possible error in mget("tasks", pos = 1, ifnotfound =
list(structure(character(0), names = character(0)))): unused argument
(pos = 1)
make.new.cd.task: possible error in mget("tasks", pos = 2, ifnotfound =
list(character(0))): unused argument (pos = 2)
- checking Rd files ... [1s/1s] 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 R/sysdata.rda ... OK
- checking examples ... [21s/64s] ERROR
Running examples in ‘mvbutils-Ex.R’ failed
The error most likely occurred in:
> ### Name: numvbderiv_parallel
> ### Title: Economy numerical derivatives
> ### Aliases: numvbderiv_parallel numvbderiv
> ### Keywords: misc
>
> ### ** Examples
>
> # Complex numbers are OK:
> numvbderiv( function( x) x*x, complex( real=1, imaginary=3))
[1] 2+6i
> # [1] 2+6i
> # Parallel example... the whole point is to show speed and generality
> # Works fine on my machine
> # But if testing under CRAN, which I normally never do,
> # then CRAN's ludicrous 2-core limit, and deliberate inability to
> # check CRANality (or even number of cores _allowed_) while running,
> # makes this completely ridiculous
> # Not for the first time
> # I have used the function 'get_ncores_CRANal' to try to get round this...
> if( require( 'doParallel')){ # auto loads foreach, iterators, parallel thx2 "Depends"
+ ncores <- detectCores( logical=FALSE)
+ scatn( '%i cores really found', ncores)
+ if( ncores > 2 ){ # pointless otherwise
+ # Need a slowish example. 1e5 is too small; 1e7 better,
+ # ... but hard on auto builders eg R-universe
+ BIGGOVAL <- 1e5
+ slowfun <- function( pars, BIGGO)
+ sum( sqr( 1+1/outer( seq_len( BIGGO), pars)))
+ parstart <- rep( 2, 8)
+ system.time(
+ dscalar <- numvbderiv( slowfun, parstart,
+ BIGGO=BIGGOVAL # named extra param (part of ...)
+ )
+ ) # scalar
+ # Make "doPar back end". I do not know what I am doing ...
+ # NB I like to leave some cores spare, hence "-1"--
+ # superstition, really
+ ncores_target <- min( ncores-1, length( parstart))
+ # Anti CRANky: ignore on your own machine:
+ # ncores_target should just work
+ ncores_avail <- get_ncores_CRANal( ncores_target)
+ scatn( 'Using %i cores eg cozza CRAN', ncores_avail)
+ CLUSTO <- makeCluster( ncores_avail)
+ registerDoParallel( CLUSTO, ncores_avail)
+ # Next bit ensures slaves can find packages... sigh.
+ # Necessary _here_ coz example, but you may not need it
+ # clusterCall does not work properly :/, so the "obvious" fails:
+ # clusterCall( CLUSTO, .libPaths, .libPaths())
+ # Instead, we are forced into this nonsense:
+ print( # for debuggery with as-CRAN
+ eval( substitute(
+ clusterEvalQ( CLUSTO, .libPaths( lb)),
+ list( lb=.libPaths())))
+ )
+ # Need 'mvbutils::sqr', hence '.packages' arg
+ scatn( 'Starting parallel time test')
+ print( system.time(
+ dpara <- numvbderiv_parallel( slowfun, parstart,
+ BIGGO=BIGGOVAL, # named extra parameter
+ FOREACH_ARGS=list( .packages= 'mvbutils')
+ )
+ )
+ )
+ scatn( 'Done')
+ print( rbind( dscalar, dpara))
+ # To refer to other data (ie beside params)
+ # best practice is to put it into function's environment
+ # (generally true, not just for numvbderiv)
+ e <- new.env()
+ e$paroffset <- c( 6, -3)
+ fun2 <- function( pars) { # not a speed test, can be smaller
+ sum( sqr( 1+1/outer( 1:1e3, pars+paroffset)))
+ }
+ environment( fun2) <- e
+ scatn( 'Scalar, using extra data via environment')
+ print( numvbderiv( fun2, parstart))
+ # Parallel version should still work, coz function's environment
+ # is also passed to slaves
+ scatn( 'Trying parallel version...')
+ print( try({
+ numvbderiv_parallel( fun2, parstart,
+ FOREACH_ARGS=list( .packages= 'mvbutils')
+ )
+ })
+ )
+ # Sometimes you do need to explicitly export stuff to the slave processes
+ # Here's a version that will get paroffset from datenv
+ # datenv must exist...
+ alt_fun2 <- function( pars){
+ environment( fun2) <- list2env( datenv)
+ fun2( pars)
+ }
+ scatn( 'With explicit data (in parallel)')
+ datenv <- as.list( e)
+ print( numvbderiv_parallel( alt_fun2, parstart,
+ FOREACH_ARGS=list(
+ .packages= 'mvbutils',
+ .export= cq( datenv, fun2) # stuff that alt_fun2 refers to
+ )
+ )
+ )
+ # Always tidy up your clusters once you have finished playing
+ stopImplicitCluster()
+ stopCluster( CLUSTO)
+ rm( CLUSTO)
+ } # if ncores>2
+ } # parallel
Loading required package: doParallel
Loading required package: foreach
Loading required package: iterators
Loading required package: parallel
6 cores really found
Error in stopCluster(CLUSTO) : CRANtidote
Calls: get_ncores_CRANal -> stopCluster
Execution halted
- checking PDF version of manual ... [11s/13s] OK
- DONE
Status: 1 ERROR, 1 NOTE
- using check arguments '--no-clean-on-error '