* using log directory ‘/data/gannet/ripley/R/packages/tests-LENGTH1/acmeR.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 ‘acmeR/DESCRIPTION’ ... OK * this is package ‘acmeR’ version ‘1.1.0’ * 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 ‘acmeR’ can be installed ... [7s/15s] 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 ... [14s/35s] 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 R/sysdata.rda ... OK * checking installed files from ‘inst/doc’ ... OK * checking files in ‘vignettes’ ... OK * checking examples ... OK * checking for unstated dependencies in vignettes ... OK * checking package vignettes in ‘inst/doc’ ... OK * checking re-building of vignette outputs ... ERROR Error(s) in re-building vignettes: --- re-building ‘acmeR_Vignette.Rmd’ using rmarkdown ----------- FAILURE REPORT -------------- --- failure: length > 1 in coercion to logical --- --- srcref --- : --- package (from environment) --- acmeR --- call from context --- read.data(fname, spec = spec, blind = blind) --- call from argument --- !missing(spec) && nchar(spec) --- R stacktrace --- where 1: read.data(fname, spec = spec, blind = blind) where 2: acme.summary(fname = altamont, spec = c("BHCO", "HOWR")) where 3: eval(expr, envir, enclos) where 4: eval(expr, envir, enclos) where 5: eval_with_user_handlers(expr, envir, enclos, user_handlers) where 6: withVisible(eval_with_user_handlers(expr, envir, enclos, user_handlers)) where 7: withCallingHandlers(withVisible(eval_with_user_handlers(expr, envir, enclos, user_handlers)), warning = wHandler, error = eHandler, message = mHandler) where 8: handle(ev <- withCallingHandlers(withVisible(eval_with_user_handlers(expr, envir, enclos, user_handlers)), warning = wHandler, error = eHandler, message = mHandler)) where 9: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval_with_user_handlers(expr, envir, enclos, user_handlers)), warning = wHandler, error = eHandler, message = mHandler))) where 10: 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 11: evaluate::evaluate(...) where 12: 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 13: in_dir(input_dir(), expr) where 14: 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 15: eng_r(options) where 16: block_exec(params) where 17: call_block(x) where 18: process_group.block(group) where 19: process_group(group) where 20: 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 21: process_file(text, output) where 22: knitr::knit(knit_input, knit_output, envir = envir, quiet = quiet) where 23: rmarkdown::render(file, encoding = encoding, quiet = quiet, envir = globalenv(), output_dir = getwd(), ...) where 24: vweave_rmarkdown(...) where 25: engine$weave(file, quiet = quiet, encoding = enc) where 26: doTryCatch(return(expr), name, parentenv, handler) where 27: tryCatchOne(expr, names, parentenv, handlers[[1L]]) where 28: tryCatchList(expr, classes, parentenv, handlers) where 29: 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 30: tools:::buildVignettes(dir = "/data/gannet/ripley/R/packages/tests-LENGTH1/acmeR.Rcheck/vign_test/acmeR") --- value of length: 2 type: integer --- [1] 4 4 --- function from context --- function (fname = "acme-sim.csv", spec = "", blind = TRUE, tz = "PST8PDT") { if (class(fname) == "character") { if (!file.exists(ofname <- fname) && !file.exists(fname <- paste(fname, "csv", sep = "."))) stop("File: \"", ofname, "\" not found") input = "csv" birds <- read.csv(fname, as.is = TRUE, stringsAsFactors = FALSE) } else if (class(fname) == "data.frame") { input = "df" birds <- fname } else { stop("Data fname must be either a file path to a CSV file, a data frame,\n or a matrix.") } fields <- c("Date", "ID", "Event", "Found") if (any(!(ok <- fields %in% names(birds)))) stop("Required fields: {", paste(fields[!ok], collapse = ", "), "} missing from data csv file \"", fname, "\".") if (!missing(spec) && nchar(spec)) { birds <- birds[ok <- which(birds$Species %in% class2spec(spec)), ] if (!any(ok)) stop("File: \"", fname, "\" contains no entries of species: ", spec) } nEvent <- dim(birds)[1] Placed <- grep("^[pP]", birds$Event) PFM <- grep("^[cC]", birds$Event) FT <- grep("^[sS]", birds$Event) isPFM <- 1:nEvent %in% PFM isFT <- 1:nEvent %in% FT isPla <- 1:nEvent %in% Placed if (!"Species" %in% names(birds)) { birds$Species <- "MISC" } if (!"Time" %in% names(birds)) { birds$Time <- numeric(length(birds$Event)) birds$Time[Placed] <- "8:00:00 AM" birds$Time[FT] <- "12:00:00 PM" birds$Time[PFM] <- "4:00:00 PM" } Days <- birds$Date Time <- birds$Time ISO.d <- grepl("^[0-9]{4,4}-[0-9]{2,2}-[0-9]{2,2} *$", Days) ISO.t <- grepl("^ *[0-9]{2,2}:[0-9]{2,2}:[0-9]{2,2} *$", Time) USA.d <- grepl("^[0-9]{1,2}/[0-9]{1,2}/[0-9]{4,4} *$", Days) USA.t <- grepl("^ *[0-9]{1,2}:[0-9]{2,2}:[0-9]{2,2} *[AaPp][Mm]$", Time) ISO.days <- all(ISO.d) ISO.times <- all(ISO.t) USA.days <- all(USA.d) USA.times <- all(USA.t) if (ISO.days & ISO.times) { fmt.dt <- "%Y-%m-%d %H:%M:%S" } else if (ISO.days & USA.times) { fmt.dt <- "%Y-%m-%d %I:%M:%S %p" } else if (USA.days & USA.times) { fmt.dt <- "%m/%d/%Y %I:%M:%S %p" } else if (USA.days & ISO.times) { fmt.dt <- "%m/%d/%Y %H:%M:%S" } else { stop("Expecting date format YYYY-MM-DD (ISO) or MM/DD/YYYY (USA)") } Date <- strptime(apply(cbind(Days, Time), 1, paste, collapse = " "), format = fmt.dt, tz = tz) nbirds <- length(Placed) IDs <- as.character(birds$ID[Placed]) if (!blind) { for (i in 1:nbirds) { srch.i <- isFT & (birds$ID == IDs[i]) succ.i <- srch.i & birds$Found if (sum(succ.i) > 1) { first.i <- min(Date[succ.i]) other.i <- succ.i & Date > first.i isFT[other.i] <- FALSE isPFM[other.i] <- TRUE } } PFM <- which(isPFM) FT <- which(isFT) } sID <- sort(IDs) if (any(sID[-1] == rev(rev(sID)[-1]))) stop("Duplicate Placement for same ID") min.date <- as.POSIXlt("0001-01-01 00:00:00", tz = tz) max.date <- as.POSIXlt("9999-12-31 00:00:00", tz = tz) scav <- data.frame(stringsAsFactors = FALSE, Species = rep(NA, nbirds), Id = birds$ID[Placed], Placed = rep(min.date, nbirds), Lo = rep(min.date, nbirds), Hi = rep(max.date, nbirds)) nDays <- numeric(nEvent) for (i in 1:nbirds) { ok <- birds$ID == IDs[i] if (any(ok)) { scav$Species[i] <- birds$Species[Placed[i]] scav$Placed[i] <- Date[Placed[i]] for (j in which(ok)) { nDays[j] <- as.numeric(difftime(Date[j], Date[Placed[i]], units = "days")) } scav$Lo[i] <- max(Date[ok & birds$Found], Date[Placed[i]]) scav$Hi[i] <- min(Date[ok & !birds$Found & isPFM & Date >= scav$Lo[i]], max.date) } } age <- numeric(nEvent) NotPlaced <- numeric(0) for (i in 1:nEvent) { arrive <- isPla & (birds$ID == birds$ID[i]) if (any(arrive)) { age[i] <- as.numeric(difftime(Date[i], Date[arrive], units = "days")) } else { NotPlaced <- c(NotPlaced, i) age[i] <- as.numeric(difftime(Date[i], min(Date), units = "days")) } } NP.Spec <- unique(birds$Species[NotPlaced]) NP.ID <- unique(birds$ID[NotPlaced]) Cint <- Sint <- numeric(0) for (i in Placed) { ok.chk <- isPFM & (birds$ID == birds$ID[i]) Cint <- c(Cint, diff(age[ok.chk])[-1]) ok.src <- isFT & (birds$ID == birds$ID[i]) Sint <- c(Sint, diff(age[ok.src])[-1]) } Ik <- c(n = length(Sint), mu = mean(Sint), sd = sd(Sint)) Sk <- c(n = length(Cint), mu = mean(Cint), sd = sd(Cint)) srch <- data.frame(Id = as.character(birds$ID), Date = Date, Days = nDays, Found = birds$Found)[FT, ] if (input == "csv") { fn = fname } else { fn = deparse(substitute(fname)) } invisible(list(scav = scav, srch = srch, Ik = Ik, Sk = Sk, NP.Spec = NP.Spec, NP.ID = NP.ID, fn = fn, Info = getId())) } --- function search by body --- Function read.data in namespace acmeR 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: 1 ERROR See ‘/data/gannet/ripley/R/packages/tests-LENGTH1/acmeR.Rcheck/00check.log’ for details. Command exited with non-zero status 1 Time 2:17.00, 46.04 + 6.61