CRAN Package Check Results for Package rcarbon

Last updated on 2019-12-06 00:50:08 CET.

Flavor Version Tinstall Tcheck Ttotal Status Flags
r-devel-linux-x86_64-debian-clang 1.2.0 7.84 50.63 58.47 ERROR
r-devel-linux-x86_64-debian-gcc 1.2.0 6.36 39.76 46.12 OK
r-devel-linux-x86_64-fedora-clang 1.2.0 65.87 NOTE
r-devel-linux-x86_64-fedora-gcc 1.2.0 65.66 NOTE
r-devel-windows-ix86+x86_64 1.2.0 11.00 85.00 96.00 OK
r-devel-windows-ix86+x86_64-gcc8 1.2.0 15.00 86.00 101.00 OK
r-patched-linux-x86_64 1.2.0 7.00 46.17 53.17 OK
r-patched-solaris-x86 1.2.0 90.30 NOTE
r-release-linux-x86_64 1.2.0 5.98 46.56 52.54 OK
r-release-windows-ix86+x86_64 1.2.0 15.00 65.00 80.00 OK
r-release-osx-x86_64 1.2.0 NOTE
r-oldrel-windows-ix86+x86_64 1.2.0 9.00 60.00 69.00 OK
r-oldrel-osx-x86_64 1.2.0 NOTE

Check Details

Version: 1.2.0
Check: examples
Result: ERROR
    Running examples in 'rcarbon-Ex.R' failed
    The error most likely occurred in:
    
    > base::assign(".ptime", proc.time(), pos = "CheckExEnv")
    > ### Name: mixCurves
    > ### Title: Creates mixed terrestrial/marine calibration curves.
    > ### Aliases: mixCurves
    >
    > ### ** Examples
    >
    > myCurve <- mixCurves('intcal13',p=0.7,resOffsets=300,resErrors=20)
    > x <- calibrate(4000,30,calCurves=myCurve)
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
    :
     --- package (from environment) ---
    rcarbon
     --- call from context ---
    calibrate.default(4000, 30, calCurves = myCurve)
     --- call from argument ---
    if (class(calCurves) %in% c("matrix", "data.frame")) {
     cctmp <- as.matrix(calCurves)
     if (ncol(cctmp) != 3 | !all(sapply(cctmp, is.numeric))) {
     stop("The custom calibration curve must have just three numeric columns.")
     }
     else {
     colnames(cctmp) <- c("CALBP", "C14BP", "Error")
     if (max(cctmp[, 2]) < max(x) | min(cctmp[, 2]) > min(x)) {
     stop("The custom calibration curve does not cover the input age range.")
     }
     cclist <- vector(mode = "list", length = 1)
     cclist[[1]] <- cctmp
     names(cclist) <- "custom"
     calCurves <- rep("custom", length(x))
     }
    } else if (!all(calCurves %in% c("intcal13", "shcal13", "marine13",
     "intcal13nhpine16", "shcal13shkauri16", "normal"))) {
     stop("calCurves must be a character vector specifying one or more known curves or a custom three-column matrix/data.frame (see ?calibrate.default).")
    } else {
     tmp <- unique(calCurves)
     if (length(calCurves) == 1) {
     calCurves <- rep(calCurves, length(x))
     }
     cclist <- vector(mode = "list", length = length(tmp))
     names(cclist) <- tmp
     for (a in 1:length(tmp)) {
     calCurveFile <- paste(system.file("extdata", package = "rcarbon"),
     "/", tmp[a], ".14c", sep = "")
     options(warn = -1)
     cctmp <- readLines(calCurveFile, encoding = "UTF-8")
     cctmp <- cctmp[!grepl("[#]", cctmp)]
     cctmp.con <- textConnection(cctmp)
     cctmp <- as.matrix(read.csv(cctmp.con, header = FALSE,
     stringsAsFactors = FALSE))[, 1:3]
     close(cctmp.con)
     options(warn = 0)
     colnames(cctmp) <- c("CALBP", "C14BP", "Error")
     cclist[[tmp[a]]] <- cctmp
     }
    }
     --- R stacktrace ---
    where 1: calibrate.default(4000, 30, calCurves = myCurve)
    where 2: calibrate(4000, 30, calCurves = myCurve)
    
     --- value of length: 2 type: logical ---
    [1] TRUE FALSE
     --- function from context ---
    function (x, errors, ids = NA, dateDetails = NA, calCurves = "intcal13",
     resOffsets = 0, resErrors = 0, timeRange = c(50000, 0), normalised = TRUE,
     calMatrix = FALSE, eps = 1e-05, ncores = 1, verbose = TRUE,
     ...)
    {
     if (ncores > 1 & !requireNamespace("doParallel", quietly = TRUE)) {
     warning("the doParallel package is required for multi-core processing; ncores has been set to 1")
     ncores = 1
     }
     if (length(x) != length(errors)) {
     stop("Ages and errors (and ids/date details/offsets if provided) must be the same length.")
     }
     if (!is.na(ids[1]) & (length(x) != length(ids))) {
     stop("Ages and errors (and ids/details/offsets if provided) must be the same length.")
     }
     if (any(is.na(x)) | any(is.na(errors))) {
     stop("Ages or errors contain NAs")
     }
     if (class(calCurves) %in% c("matrix", "data.frame")) {
     cctmp <- as.matrix(calCurves)
     if (ncol(cctmp) != 3 | !all(sapply(cctmp, is.numeric))) {
     stop("The custom calibration curve must have just three numeric columns.")
     }
     else {
     colnames(cctmp) <- c("CALBP", "C14BP", "Error")
     if (max(cctmp[, 2]) < max(x) | min(cctmp[, 2]) >
     min(x)) {
     stop("The custom calibration curve does not cover the input age range.")
     }
     cclist <- vector(mode = "list", length = 1)
     cclist[[1]] <- cctmp
     names(cclist) <- "custom"
     calCurves <- rep("custom", length(x))
     }
     }
     else if (!all(calCurves %in% c("intcal13", "shcal13", "marine13",
     "intcal13nhpine16", "shcal13shkauri16", "normal"))) {
     stop("calCurves must be a character vector specifying one or more known curves or a custom three-column matrix/data.frame (see ?calibrate.default).")
     }
     else {
     tmp <- unique(calCurves)
     if (length(calCurves) == 1) {
     calCurves <- rep(calCurves, length(x))
     }
     cclist <- vector(mode = "list", length = length(tmp))
     names(cclist) <- tmp
     for (a in 1:length(tmp)) {
     calCurveFile <- paste(system.file("extdata", package = "rcarbon"),
     "/", tmp[a], ".14c", sep = "")
     options(warn = -1)
     cctmp <- readLines(calCurveFile, encoding = "UTF-8")
     cctmp <- cctmp[!grepl("[#]", cctmp)]
     cctmp.con <- textConnection(cctmp)
     cctmp <- as.matrix(read.csv(cctmp.con, header = FALSE,
     stringsAsFactors = FALSE))[, 1:3]
     close(cctmp.con)
     options(warn = 0)
     colnames(cctmp) <- c("CALBP", "C14BP", "Error")
     cclist[[tmp[a]]] <- cctmp
     }
     }
     reslist <- vector(mode = "list", length = 2)
     sublist <- vector(mode = "list", length = length(x))
     if (calMatrix) {
     calmBP <- seq(timeRange[1], timeRange[2], -1)
     calmat <- matrix(ncol = length(x), nrow = length(calmBP))
     rownames(calmat) <- calmBP
     calmat[] <- 0
     }
     if (is.na(ids[1])) {
     ids <- as.character(1:length(x))
     }
     else {
     ids <- as.character(ids)
     if (any(duplicated(ids))) {
     stop("The values in the ids argument must be unique or left as defaults.")
     }
     }
     if (length(resOffsets) == 1) {
     resOffsets <- rep(resOffsets, length(x))
     }
     if (length(resErrors) == 1) {
     resErrors <- rep(resErrors, length(x))
     }
     names(sublist) <- ids
     names(reslist) <- c("metadata", "grids")
     if (length(x) > 1 & verbose) {
     print("Calibrating radiocarbon ages...")
     flush.console()
     pb <- txtProgressBar(min = 1, max = length(x), style = 3)
     }
     if (ncores > 1) {
     cl <- makeCluster(ncores)
     registerDoParallel(cl)
     if (verbose) {
     print(paste("Running in parallel (standard calibration only) on ",
     getDoParWorkers(), " workers...", sep = ""))
     }
     sublist <- foreach(b = 1:length(x)) %dopar% {
     calcurve <- cclist[[calCurves[b]]]
     calBP <- seq(max(calcurve), min(calcurve), -1)
     age <- x[b] - resOffsets[b]
     error <- errors[b] + resErrors[b]
     mu <- approx(calcurve[, 1], calcurve[, 2], xout = calBP)$y
     tau <- error^2 + approx(calcurve[, 1], calcurve[,
     3], xout = calBP)$y^2
     dens <- dnorm(age, mean = mu, sd = sqrt(tau))
     dens[dens < eps] <- 0
     if (normalised) {
     dens <- dens/sum(dens)
     dens[dens < eps] <- 0
     dens <- dens/sum(dens)
     }
     res <- data.frame(calBP = calBP, PrDens = dens)
     res <- res[which(calBP <= timeRange[1] & calBP >=
     timeRange[2]), ]
     res <- res[res$PrDens > 0, ]
     class(res) <- append(class(res), "calGrid")
     return(res)
     }
     stopCluster(cl)
     names(sublist) <- ids
     if (calMatrix) {
     for (a in 1:length(sublist)) {
     calmat[as.character(sublist[[a]]$calBP), a] <- sublist[[a]]$PrDens
     }
     }
     }
     else {
     for (b in 1:length(x)) {
     if (length(x) > 1 & verbose) {
     setTxtProgressBar(pb, b)
     }
     calcurve <- cclist[[calCurves[b]]]
     calBP <- seq(max(calcurve), min(calcurve), -1)
     age <- x[b] - resOffsets[b]
     error <- errors[b] + resErrors[b]
     mu <- approx(calcurve[, 1], calcurve[, 2], xout = calBP)$y
     tau <- error^2 + approx(calcurve[, 1], calcurve[,
     3], xout = calBP)$y^2
     dens <- dnorm(age, mean = mu, sd = sqrt(tau))
     dens[dens < eps] <- 0
     if (normalised) {
     dens <- dens/sum(dens)
     dens[dens < eps] <- 0
     dens <- dens/sum(dens)
     }
     res <- data.frame(calBP = calBP, PrDens = dens)
     res <- res[which(calBP <= timeRange[1] & calBP >=
     timeRange[2]), ]
     if (calMatrix) {
     calmat[, b] <- res$PrDens
     }
     res <- res[res$PrDens > 0, ]
     class(res) <- append(class(res), "calGrid")
     sublist[[ids[b]]] <- res
     }
     }
     if (length(x) > 1 & verbose) {
     close(pb)
     }
     df <- data.frame(DateID = ids, CRA = x, Error = errors, Details = dateDetails,
     CalCurve = calCurves, ResOffsets = resOffsets, ResErrors = resErrors,
     StartBP = timeRange[1], EndBP = timeRange[2], Normalised = normalised,
     CalEPS = eps, stringsAsFactors = FALSE)
     reslist[["metadata"]] <- df
     if (calMatrix) {
     reslist[["grids"]] <- NA
     reslist[["calmatrix"]] <- calmat
     }
     else {
     reslist[["grids"]] <- sublist
     reslist[["calmatrix"]] <- NA
     }
     class(reslist) <- c("CalDates", class(reslist))
     if (verbose) {
     print("Done.")
     }
     return(reslist)
    }
    <bytecode: 0x3519150>
    <environment: namespace:rcarbon>
     --- function search by body ---
    Function calibrate.default in namespace rcarbon has this body.
     ----------- END OF FAILURE REPORT --------------
    Fatal error: the condition has length > 1
Flavor: r-devel-linux-x86_64-debian-clang

Version: 1.2.0
Check: dependencies in R code
Result: NOTE
    Namespace in Imports field not imported from: ‘knitr’
     All declared Imports should be used.
Flavors: r-devel-linux-x86_64-fedora-clang, r-devel-linux-x86_64-fedora-gcc, r-patched-solaris-x86, r-release-osx-x86_64, r-oldrel-osx-x86_64