* using log directory ‘/data/gannet/ripley/R/packages/tests-LENGTH1/SK.Rcheck’ * using R Under development (unstable) (2022-04-26 r82260) * using platform: x86_64-pc-linux-gnu (64-bit) * using session charset: UTF-8 * using option ‘--no-stop-on-test-error’ * checking for file ‘SK/DESCRIPTION’ ... OK * checking extension type ... Package * this is package ‘SK’ version ‘1.1’ * 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 ... OK * checking for portable file names ... OK * checking for sufficient/correct file permissions ... OK * checking whether package ‘SK’ can be installed ... [9s/18s] OK * checking package directory ... OK * checking ‘build’ 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 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 loading without being on the library search path ... OK * checking use of S3 registration ... 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 ... [11s/28s] OK * checking Rd files ... OK * checking Rd metadata ... OK * checking Rd line widths ... 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 contents of ‘data’ directory ... OK * checking data for non-ASCII characters ... OK * checking LazyData ... OK * checking data for ASCII and uncompressed saves ... OK * checking installed files from ‘inst/doc’ ... OK * checking files in ‘vignettes’ ... OK * checking examples ... [5s/12s] ERROR Running examples in ‘SK-Ex.R’ failed The error most likely occurred in: > ### Name: skriging > ### Title: Function for Segment-based Kriging models > ### Aliases: skriging print.skriging plot.skriging > > ### ** Examples > > ## SRK: segment-based regression Kriging > ## dataset 'vtest' is a sample of dataset 'vehicles' > srk1 <- skriging(heavy ~ wpai + width, polyline = vtest, method = "srk", + lwd = "width", obspred = "obs1pred0", boxcox = TRUE) Warning in wkt(obj) : CRS object has no comment Warning in wkt(obj) : CRS object has no comment ----------- FAILURE REPORT -------------- --- failure: length > 1 in coercion to logical --- --- srcref --- : --- package (from environment) --- SK --- call from context --- skriging(heavy ~ wpai + width, polyline = vtest, method = "srk", lwd = "width", obspred = "obs1pred0", boxcox = TRUE) --- call from argument --- method == "srk" && xx != 1 --- R stacktrace --- where 1: skriging(heavy ~ wpai + width, polyline = vtest, method = "srk", lwd = "width", obspred = "obs1pred0", boxcox = TRUE) --- value of length: 3 type: logical --- [1] TRUE TRUE TRUE --- function from context --- function (formula, polyline = polyline, method = "srk", lwd = "width", obspred = "obs1pred0", boxcox = TRUE) { formula <- as.formula(formula) namepolyline <- names(polyline) y <- polyline@data[, namepolyline == formula[[2]]] polyline$y <- y if (class(lwd) == "character") { width1 <- polyline@data[, namepolyline == lwd] } else if (class(lwd) == "numeric") { width1 <- rep(lwd, nrow(polyline@data)) } else { warnings("lwd should be a number or a variable of polyline.") } op1 <- polyline@data[, namepolyline == obspred] polyline$obspred <- op1 if (boxcox == TRUE) { k <- which(op1 == 1) polyline$transh <- NA bxcxt1 <- bxcxt(y[k], width1[k]) polyline$transh[k] <- bxcxt1[[1]] trans1 <- bxcxt1[[2]] } else { polyline$transh <- y } linebf <- gBuffer(polyline, width = width1, byid = TRUE) linebf <- SpatialPolygonsDataFrame(linebf, data = linebf@data) linebf_obs <- linebf[which(op1 == 1), ] linebf_pred <- linebf[which(op1 == 0), ] xx <- as.character(formula[[3]]) formula2 <- NA if (method == "sok" && xx == 1) { formula2 <- as.formula(paste("transh", paste(xx, collapse = " + "), sep = " ~ ")) } else if (method == "srk" && xx != 1) { xx <- xx[-which(xx == "+")] formula2 <- as.formula(paste("transh", paste(xx, collapse = " + "), sep = " ~ ")) } else if (method == "sok" && xx != 1) { cat("In SOK model, the form of formula should be 'y ~ 1'.\n") } else { cat("In SRK model, one or several exxplanatory variables are required.\n") } lmh <- lm(formula2, data = linebf_obs) pred.lmh <- predict(lmh, linebf_pred, se.fit = FALSE) linebf_obs$transh_res <- lmh$residuals invisible(capture.output(rtopkriging <- createRtopObject(linebf_obs, linebf_pred, formulaString = transh_res ~ 1, params = list(gDist = TRUE, rresol = 25)))) invisible(capture.output(rtopkriging <- rtopFitVariogram(rtopkriging))) invisible(capture.output(rtopkriging <- rtopKrige(rtopkriging))) pred.rtoph <- rtopkriging$predictions$var1.pred pred1 <- pred.lmh + pred.rtoph stdev1 <- sqrt(rtopkriging$predictions$var1.var) if (boxcox == TRUE) { inverstranspred1 <- bxcx(pred1, trans1, InverseQ = TRUE) inverstransstdev1 <- (pred1 * trans1 + 1)^((1 - trans1)/trans1) * stdev1 uncertainty1 <- inverstransstdev1/inverstranspred1 } else { inverstranspred1 <- pred1 inverstransstdev1 <- stdev1 uncertainty1 <- inverstransstdev1/inverstranspred1 } polyline$y[op1 == 0] <- inverstranspred1 polyline$stdev <- NA polyline$stdev[op1 == 0] <- inverstransstdev1 polyline$uncertainty <- NA polyline$uncertainty[op1 == 0] <- uncertainty1 result <- list(polyline = polyline) class(result) <- "skriging" result } --- function search by body --- Function skriging in namespace SK has this body. ----------- END OF FAILURE REPORT -------------- Fatal error: length > 1 in coercion to logical * checking for unstated dependencies in vignettes ... OK * checking package vignettes in ‘inst/doc’ ... OK * checking re-building of vignette outputs ... [7s/15s] ERROR Error(s) in re-building vignettes: --- re-building ‘SK.Rmd’ using rmarkdown ----------- FAILURE REPORT -------------- --- failure: length > 1 in coercion to logical --- --- srcref --- : --- package (from environment) --- SK --- call from context --- skriging(heavy ~ wpai + width, polyline = vehicles, method = "srk", lwd = "width", obspred = "obs1pred0", boxcox = TRUE) --- call from argument --- method == "srk" && xx != 1 --- R stacktrace --- where 1: skriging(heavy ~ wpai + width, polyline = vehicles, method = "srk", lwd = "width", obspred = "obs1pred0", boxcox = TRUE) where 2: eval(expr, envir, enclos) where 3: eval(expr, envir, enclos) where 4: eval_with_user_handlers(expr, envir, enclos, user_handlers) where 5: withVisible(eval_with_user_handlers(expr, envir, enclos, user_handlers)) where 6: withCallingHandlers(withVisible(eval_with_user_handlers(expr, envir, enclos, user_handlers)), warning = wHandler, error = eHandler, message = mHandler) where 7: handle(ev <- withCallingHandlers(withVisible(eval_with_user_handlers(expr, envir, enclos, user_handlers)), warning = wHandler, error = eHandler, message = mHandler)) where 8: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval_with_user_handlers(expr, envir, enclos, user_handlers)), 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 (is.numeric(options$error)) options$error else { if (options$error && options$include) 0L else 2L }, output_handler = knit_handlers(options$render, options)) where 12: in_dir(input_dir(), expr) where 13: in_input_dir(evaluate(code, envir = env, new_device = FALSE, keep_warning = !isFALSE(options$warning), keep_message = !isFALSE(options$message), stop_on_error = if (is.numeric(options$error)) options$error else { if (options$error && options$include) 0L else 2L }, output_handler = knit_handlers(options$render, options))) where 14: eng_r(options) where 15: block_exec(params) where 16: call_block(x) where 17: process_group.block(group) where 18: process_group(group) where 19: 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 20: process_file(text, output) where 21: knitr::knit(knit_input, knit_output, envir = envir, quiet = quiet) where 22: rmarkdown::render(file, encoding = encoding, quiet = quiet, envir = globalenv(), output_dir = getwd(), ...) where 23: vweave_rmarkdown(...) where 24: engine$weave(file, quiet = quiet, encoding = enc) where 25: doTryCatch(return(expr), name, parentenv, handler) where 26: tryCatchOne(expr, names, parentenv, handlers[[1L]]) where 27: tryCatchList(expr, classes, parentenv, handlers) where 28: 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 29: tools:::buildVignettes(dir = "/data/gannet/ripley/R/packages/tests-LENGTH1/SK.Rcheck/vign_test/SK") --- value of length: 3 type: logical --- [1] TRUE TRUE TRUE --- function from context --- function (formula, polyline = polyline, method = "srk", lwd = "width", obspred = "obs1pred0", boxcox = TRUE) { formula <- as.formula(formula) namepolyline <- names(polyline) y <- polyline@data[, namepolyline == formula[[2]]] polyline$y <- y if (class(lwd) == "character") { width1 <- polyline@data[, namepolyline == lwd] } else if (class(lwd) == "numeric") { width1 <- rep(lwd, nrow(polyline@data)) } else { warnings("lwd should be a number or a variable of polyline.") } op1 <- polyline@data[, namepolyline == obspred] polyline$obspred <- op1 if (boxcox == TRUE) { k <- which(op1 == 1) polyline$transh <- NA bxcxt1 <- bxcxt(y[k], width1[k]) polyline$transh[k] <- bxcxt1[[1]] trans1 <- bxcxt1[[2]] } else { polyline$transh <- y } linebf <- gBuffer(polyline, width = width1, byid = TRUE) linebf <- SpatialPolygonsDataFrame(linebf, data = linebf@data) linebf_obs <- linebf[which(op1 == 1), ] linebf_pred <- linebf[which(op1 == 0), ] xx <- as.character(formula[[3]]) formula2 <- NA if (method == "sok" && xx == 1) { formula2 <- as.formula(paste("transh", paste(xx, collapse = " + "), sep = " ~ ")) } else if (method == "srk" && xx != 1) { xx <- xx[-which(xx == "+")] formula2 <- as.formula(paste("transh", paste(xx, collapse = " + "), sep = " ~ ")) } else if (method == "sok" && xx != 1) { cat("In SOK model, the form of formula should be 'y ~ 1'.\n") } else { cat("In SRK model, one or several exxplanatory variables are required.\n") } lmh <- lm(formula2, data = linebf_obs) pred.lmh <- predict(lmh, linebf_pred, se.fit = FALSE) linebf_obs$transh_res <- lmh$residuals invisible(capture.output(rtopkriging <- createRtopObject(linebf_obs, linebf_pred, formulaString = transh_res ~ 1, params = list(gDist = TRUE, rresol = 25)))) invisible(capture.output(rtopkriging <- rtopFitVariogram(rtopkriging))) invisible(capture.output(rtopkriging <- rtopKrige(rtopkriging))) pred.rtoph <- rtopkriging$predictions$var1.pred pred1 <- pred.lmh + pred.rtoph stdev1 <- sqrt(rtopkriging$predictions$var1.var) if (boxcox == TRUE) { inverstranspred1 <- bxcx(pred1, trans1, InverseQ = TRUE) inverstransstdev1 <- (pred1 * trans1 + 1)^((1 - trans1)/trans1) * stdev1 uncertainty1 <- inverstransstdev1/inverstranspred1 } else { inverstranspred1 <- pred1 inverstransstdev1 <- stdev1 uncertainty1 <- inverstransstdev1/inverstranspred1 } polyline$y[op1 == 0] <- inverstranspred1 polyline$stdev <- NA polyline$stdev[op1 == 0] <- inverstransstdev1 polyline$uncertainty <- NA polyline$uncertainty[op1 == 0] <- uncertainty1 result <- list(polyline = polyline) class(result) <- "skriging" result } --- function search by body --- Function skriging in namespace SK has this body. ----------- END OF FAILURE REPORT -------------- Fatal error: length > 1 in coercion to logical * checking PDF version of manual ... OK * checking for non-standard things in the check directory ... OK * checking for detritus in the temp directory ... OK * DONE Status: 2 ERRORs See ‘/data/gannet/ripley/R/packages/tests-LENGTH1/SK.Rcheck/00check.log’ for details. Command exited with non-zero status 1 Time 3:26.37, 77.99 + 10.43