CRAN Package Check Results for Package MBHdesign

Last updated on 2019-12-05 12:48:40 CET.

Flavor Version Tinstall Tcheck Ttotal Status Flags
r-devel-linux-x86_64-debian-clang 2.1.5 7.03 72.45 79.48 ERROR
r-devel-linux-x86_64-debian-gcc 2.1.5 8.01 86.08 94.09 OK
r-devel-linux-x86_64-fedora-clang 2.1.5 152.39 OK
r-devel-linux-x86_64-fedora-gcc 2.1.5 148.20 OK
r-devel-windows-ix86+x86_64 2.1.5 15.00 491.00 506.00 OK
r-devel-windows-ix86+x86_64-gcc8 2.1.5 16.00 514.00 530.00 OK
r-patched-linux-x86_64 2.1.5 6.91 103.49 110.40 OK
r-patched-solaris-x86 2.1.5 861.30 OK
r-release-linux-x86_64 2.1.5 8.03 105.07 113.10 OK
r-release-windows-ix86+x86_64 2.1.5 20.00 479.00 499.00 OK
r-release-osx-x86_64 2.1.5 OK
r-oldrel-windows-ix86+x86_64 2.1.5 9.00 501.00 510.00 OK
r-oldrel-osx-x86_64 2.1.5 OK

Check Details

Version: 2.1.5
Check: examples
Result: ERROR
    Running examples in 'MBHdesign-Ex.R' failed
    The error most likely occurred in:
    
    > base::assign(".ptime", proc.time(), pos = "CheckExEnv")
    > ### Name: modEsti
    > ### Title: Get a model-based estimate of mean of a sampled area
    > ### Aliases: modEsti
    > ### Keywords: misc
    >
    > ### ** Examples
    >
    > #set up design parameters
    > #taken from the example in alterInclProbs()
    > #big plane today
    > set.seed(747)
    > #the number of potential sampling locations
    > N <- 50^2
    > #number of samples
    > n <- 27
    > #number of legacy sites
    > nLegacy <- 3
    > #the grid
    > X <- as.matrix( expand.grid( 1:sqrt( N), 1:sqrt(N)) / sqrt(N) - 1/(2*sqrt(N)))
    > #the inclusion probabiltiies with gradient according to non-linear function of X[,1]
    > p <- 1-exp(-X[,1])
    > #standardise to get n samples
    > p <- n * p / sum( p)
    > #randomly choose legacy sites
    > legacySites <- sample( 1:N, nLegacy, prob=p)
    > #alter inclusion probabilities for legacy sites
    > p2 <- alterInclProbs( legacy.sites=X[legacySites,], potential.sites=X, inclusion.probs=p)
    > #get the sample
    > samp <- quasiSamp( n=n, dimension=2, potential.sites=X, inclusion.probs=p2)
    No study.area defined. Using an interval/rectangle/hyper-rectangle based on the extreme locations in potential.sites
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
    :
     --- package (from environment) ---
    MBHdesign
     --- call from context ---
    setDesignParams(dimension, study.area, potential.sites, inclusion.probs)
     --- call from argument ---
    if (!class(potential.sites) %in% c("matrix", "data.frame")) potential.sites <- as.matrix(potential.sites)
     --- R stacktrace ---
    where 1: setDesignParams(dimension, study.area, potential.sites, inclusion.probs)
    where 2: quasiSamp(n = n, dimension = 2, potential.sites = X, inclusion.probs = p2)
    
     --- value of length: 2 type: logical ---
    [1] FALSE TRUE
     --- function from context ---
    function (dimension, study.area, potential.sites, inclusion.probs)
    {
     if (is.null(study.area)) {
     if (is.null(potential.sites)) {
     message("No study.area defined and no potential.sites given. Using unit interval/square/cube/hyper-cube (as dimension dictates)")
     N <- 100
     potential.sites <- as.matrix(expand.grid(as.data.frame(matrix(rep(1:N,
     times = dimension), ncol = dimension)))/N - 1/(2 *
     N))
     study.area <- as.matrix(expand.grid(as.data.frame(matrix(c(rep(0,
     dimension), rep(1, dimension)), nrow = 2, byrow = TRUE))))
     colnames(potential.sites) <- colnames(study.area) <- paste0("dimension",
     1:dimension)
     }
     else {
     message("No study.area defined. Using an interval/rectangle/hyper-rectangle based on the extreme locations in potential.sites")
     if (!class(potential.sites) %in% c("matrix", "data.frame"))
     potential.sites <- as.matrix(potential.sites)
     if (is.null(colnames(potential.sites)))
     colnames(potential.sites) <- paste0("dimension",
     1:dimension)
     study.area <- as.matrix(expand.grid(as.data.frame(apply(potential.sites,
     -1, range))))
     colnames(study.area) <- colnames(potential.sites)
     }
     if (dimension == 2)
     study.area <- study.area[c(1, 3, 4, 2), ]
     }
     if (!class(study.area) %in% c("matrix", "data.frame"))
     study.area <- as.matrix(study.area)
     if (is.null(colnames(study.area)))
     colnames(study.area) <- paste0("dimension", 1:dimension)
     if (is.null(potential.sites)) {
     message("Sampling from a 100x100 grid (max -- will be cropped) within the study area (well hyper-rectangle if dimension>2)")
     N <- 100
     potential.sites <- as.matrix(expand.grid(as.data.frame(matrix(rep(1:N,
     times = dimension), ncol = dimension)))/N - 1/(2 *
     N))
     colnames(potential.sites) <- paste0("dimension", 1:dimension)
     myRange <- apply(study.area, -1, range)
     for (ii in 1:dimension) {
     potential.sites[, ii] <- myRange[1, ii] + (myRange[2,
     ii] - myRange[1, ii]) * potential.sites[, ii]
     }
     if (dimension == 2) {
     tmp <- mgcv::in.out(study.area, potential.sites)
     potential.sites <- potential.sites[tmp, ]
     }
     if (dimension > 2)
     message("Sampling grid not checked for interior of study area (please do so yourself)")
     }
     N <- nrow(potential.sites)
     if (dimension != ncol(potential.sites))
     stop("The dimension supplied does not match the dimension that the potential.sites implies")
     if (is.null(inclusion.probs)) {
     message("No inclusion.probs supplied, assuming uniform")
     inclusion.probs <- rep(1/N, N)
     }
     inclusion.probs1 <- inclusion.probs/max(inclusion.probs,
     na.rm = TRUE)
     ret <- list(dimension = dimension, study.area = study.area,
     potential.sites = potential.sites, inclusion.probs = inclusion.probs,
     inclusion.probs1 = inclusion.probs1, N = N)
     return(ret)
    }
    <bytecode: 0x6f035d8>
    <environment: namespace:MBHdesign>
     --- function search by body ---
     ----------- END OF FAILURE REPORT --------------
    Fatal error: the condition has length > 1
Flavor: r-devel-linux-x86_64-debian-clang

Version: 2.1.5
Check: re-building of vignette outputs
Result: WARN
    Error(s) in re-building vignettes:
     ...
    --- re-building 'MBHdesign.Rnw' using knitr
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
    :
     --- package (from environment) ---
    MBHdesign
     --- call from context ---
    setDesignParams(dimension, study.area, potential.sites, inclusion.probs)
     --- call from argument ---
    if (!class(study.area) %in% c("matrix", "data.frame")) study.area <- as.matrix(study.area)
     --- R stacktrace ---
    where 1: setDesignParams(dimension, study.area, potential.sites, inclusion.probs)
    where 2: quasiSamp(n = n, dimension = 2, study.area = matrix(c(0, 0, 0,
     1, 1, 1, 1, 0), ncol = 2, byrow = TRUE), potential.sites = X,
     inclusion.probs = altInclProbs)
    where 3: eval(expr, envir, enclos)
    where 4: eval(expr, envir, enclos)
    where 5: withVisible(eval(expr, envir, enclos))
    where 6: withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler,
     error = eHandler, message = mHandler)
    where 7: handle(ev <- withCallingHandlers(withVisible(eval(expr, envir,
     enclos)), warning = wHandler, error = eHandler, message = mHandler))
    where 8: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval(expr,
     envir, enclos)), warning = wHandler, error = eHandler, message = mHandler)))
    where 9: evaluate_call(expr, parsed$src[[i]], envir = envir, enclos = enclos,
     debug = debug, last = i == length(out), use_try = stop_on_error !=
     2L, keep_warning = keep_warning, keep_message = keep_message,
     output_handler = output_handler, include_timing = include_timing)
    where 10: evaluate::evaluate(...)
    where 11: evaluate(code, envir = env, new_device = FALSE, keep_warning = !isFALSE(options$warning),
     keep_message = !isFALSE(options$message), stop_on_error = if (options$error &&
     options$include) 0L else 2L, output_handler = knit_handlers(options$render,
     options))
    where 12: in_dir(input_dir(), evaluate(code, envir = env, new_device = FALSE,
     keep_warning = !isFALSE(options$warning), keep_message = !isFALSE(options$message),
     stop_on_error = if (options$error && options$include) 0L else 2L,
     output_handler = knit_handlers(options$render, options)))
    where 13: block_exec(params)
    where 14: call_block(x)
    where 15: process_group.block(group)
    where 16: process_group(group)
    where 17: withCallingHandlers(if (tangle) process_tangle(group) else process_group(group),
     error = function(e) {
     setwd(wd)
     cat(res, sep = "\n", file = output %n% "")
     message("Quitting from lines ", paste(current_lines(i),
     collapse = "-"), " (", knit_concord$get("infile"),
     ") ")
     })
    where 18: process_file(text, output)
    where 19: (if (grepl("\\.[Rr]md$", file)) knit2html_v1 else if (grepl("\\.[Rr]rst$",
     file)) knit2pandoc else knit)(file, encoding = encoding,
     quiet = quiet, envir = globalenv(), ...)
    where 20: engine$weave(file, quiet = quiet, encoding = enc)
    where 21: doTryCatch(return(expr), name, parentenv, handler)
    where 22: tryCatchOne(expr, names, parentenv, handlers[[1L]])
    where 23: tryCatchList(expr, classes, parentenv, handlers)
    where 24: tryCatch({
     engine$weave(file, quiet = quiet, encoding = enc)
     setwd(startdir)
     output <- find_vignette_product(name, by = "weave", engine = engine)
     if (!have.makefile && vignette_is_tex(output)) {
     texi2pdf(file = output, clean = FALSE, quiet = quiet)
     output <- find_vignette_product(name, by = "texi2pdf",
     engine = engine)
     }
     outputs <- c(outputs, output)
    }, error = function(e) {
     thisOK <<- FALSE
     fails <<- c(fails, file)
     message(gettextf("Error: processing vignette '%s' failed with diagnostics:\n%s",
     file, conditionMessage(e)))
    })
    where 25: tools:::buildVignettes(dir = "/home/hornik/tmp/R.check/r-devel-clang/Work/PKGS/MBHdesign.Rcheck/vign_test/MBHdesign",
     ser_elibs = "/tmp/Rtmpugf0Bf/file1b28622989d.rds")
    
     --- value of length: 2 type: logical ---
    [1] FALSE TRUE
     --- function from context ---
    function (dimension, study.area, potential.sites, inclusion.probs)
    {
     if (is.null(study.area)) {
     if (is.null(potential.sites)) {
     message("No study.area defined and no potential.sites given. Using unit interval/square/cube/hyper-cube (as dimension dictates)")
     N <- 100
     potential.sites <- as.matrix(expand.grid(as.data.frame(matrix(rep(1:N,
     times = dimension), ncol = dimension)))/N - 1/(2 *
     N))
     study.area <- as.matrix(expand.grid(as.data.frame(matrix(c(rep(0,
     dimension), rep(1, dimension)), nrow = 2, byrow = TRUE))))
     colnames(potential.sites) <- colnames(study.area) <- paste0("dimension",
     1:dimension)
     }
     else {
     message("No study.area defined. Using an interval/rectangle/hyper-rectangle based on the extreme locations in potential.sites")
     if (!class(potential.sites) %in% c("matrix", "data.frame"))
     potential.sites <- as.matrix(potential.sites)
     if (is.null(colnames(potential.sites)))
     colnames(potential.sites) <- paste0("dimension",
     1:dimension)
     study.area <- as.matrix(expand.grid(as.data.frame(apply(potential.sites,
     -1, range))))
     colnames(study.area) <- colnames(potential.sites)
     }
     if (dimension == 2)
     study.area <- study.area[c(1, 3, 4, 2), ]
     }
     if (!class(study.area) %in% c("matrix", "data.frame"))
     study.area <- as.matrix(study.area)
     if (is.null(colnames(study.area)))
     colnames(study.area) <- paste0("dimension", 1:dimension)
     if (is.null(potential.sites)) {
     message("Sampling from a 100x100 grid (max -- will be cropped) within the study area (well hyper-rectangle if dimension>2)")
     N <- 100
     potential.sites <- as.matrix(expand.grid(as.data.frame(matrix(rep(1:N,
     times = dimension), ncol = dimension)))/N - 1/(2 *
     N))
     colnames(potential.sites) <- paste0("dimension", 1:dimension)
     myRange <- apply(study.area, -1, range)
     for (ii in 1:dimension) {
     potential.sites[, ii] <- myRange[1, ii] + (myRange[2,
     ii] - myRange[1, ii]) * potential.sites[, ii]
     }
     if (dimension == 2) {
     tmp <- mgcv::in.out(study.area, potential.sites)
     potential.sites <- potential.sites[tmp, ]
     }
     if (dimension > 2)
     message("Sampling grid not checked for interior of study area (please do so yourself)")
     }
     N <- nrow(potential.sites)
     if (dimension != ncol(potential.sites))
     stop("The dimension supplied does not match the dimension that the potential.sites implies")
     if (is.null(inclusion.probs)) {
     message("No inclusion.probs supplied, assuming uniform")
     inclusion.probs <- rep(1/N, N)
     }
     inclusion.probs1 <- inclusion.probs/max(inclusion.probs,
     na.rm = TRUE)
     ret <- list(dimension = dimension, study.area = study.area,
     potential.sites = potential.sites, inclusion.probs = inclusion.probs,
     inclusion.probs1 = inclusion.probs1, N = N)
     return(ret)
    }
    <bytecode: 0xaff0018>
    <environment: namespace:MBHdesign>
     --- function search by body ---
    Function setDesignParams in namespace MBHdesign has this body.
     ----------- END OF FAILURE REPORT --------------
    Fatal error: the condition has length > 1
Flavor: r-devel-linux-x86_64-debian-clang