CRAN Package Check Results for Package BBRecapture

Last updated on 2019-12-06 08:54:42 CET.

Flavor Version Tinstall Tcheck Ttotal Status Flags
r-devel-linux-x86_64-debian-clang 0.1 19.04 108.59 127.63 ERROR
r-devel-linux-x86_64-debian-gcc 0.1 13.01 84.42 97.43 NOTE
r-devel-linux-x86_64-fedora-clang 0.1 161.33 NOTE
r-devel-linux-x86_64-fedora-gcc 0.1 144.04 NOTE
r-devel-windows-ix86+x86_64 0.1 24.00 105.00 129.00 NOTE
r-devel-windows-ix86+x86_64-gcc8 0.1 26.00 102.00 128.00 NOTE
r-patched-linux-x86_64 0.1 16.86 98.86 115.72 NOTE
r-patched-solaris-x86 0.1 211.00 NOTE
r-release-linux-x86_64 0.1 15.85 99.10 114.95 NOTE
r-release-windows-ix86+x86_64 0.1 36.00 98.00 134.00 NOTE
r-release-osx-x86_64 0.1 NOTE
r-oldrel-windows-ix86+x86_64 0.1 16.00 102.00 118.00 NOTE
r-oldrel-osx-x86_64 0.1 NOTE

Check Details

Version: 0.1
Check: DESCRIPTION meta-information
Result: NOTE
    Malformed Description field: should contain one or more complete sentences.
Flavors: r-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-debian-gcc, r-devel-linux-x86_64-fedora-clang, r-devel-linux-x86_64-fedora-gcc, r-devel-windows-ix86+x86_64, r-devel-windows-ix86+x86_64-gcc8, r-patched-linux-x86_64, r-patched-solaris-x86, r-release-linux-x86_64, r-release-windows-ix86+x86_64, r-release-osx-x86_64, r-oldrel-windows-ix86+x86_64, r-oldrel-osx-x86_64

Version: 0.1
Check: dependencies in R code
Result: NOTE
    Packages in Depends field not imported from:
     'HI' 'lme4' 'locfit' 'secr'
     These packages need to be imported from (in the NAMESPACE file)
     for when this namespace is loaded but not attached.
Flavors: r-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-debian-gcc, r-devel-linux-x86_64-fedora-clang, r-devel-linux-x86_64-fedora-gcc, r-devel-windows-ix86+x86_64, r-devel-windows-ix86+x86_64-gcc8, r-patched-linux-x86_64, r-patched-solaris-x86, r-release-linux-x86_64, r-release-windows-ix86+x86_64, r-release-osx-x86_64, r-oldrel-windows-ix86+x86_64, r-oldrel-osx-x86_64

Version: 0.1
Check: R code for possible problems
Result: NOTE
    BBRecap: no visible global function definition for 'optimize'
    BBRecap: no visible global function definition for 'arms'
    BBRecap: no visible global function definition for 'median'
    BBRecap : HPD.interval: no visible global function definition for
     'density'
    BBRecap : HPD.interval: no visible global function definition for
     'quantile'
    BBRecap.custom.part: no visible global function definition for
     'optimize'
    LBRecap: no visible global function definition for 'findbars'
    LBRecap: no visible global function definition for 'as.formula'
    LBRecap: no visible global function definition for 'glm'
    LBRecap: no visible global function definition for 'binomial'
    LBRecap: no visible global function definition for 'glmer'
    LBRecap: no visible global function definition for 'logLik'
    LBRecap: no visible global function definition for 'coef'
    LBRecap: no visible global function definition for 'na.omit'
    LBRecap: no visible global function definition for 'fixef'
    LBRecap: no visible global function definition for 'ranef'
    LBRecap: no visible global function definition for 'qnorm'
    LBRecap: no visible global function definition for 'plot'
    LBRecap: no visible global function definition for 'points'
    LBRecap: no visible global function definition for 'axis'
    LBRecap: no visible global function definition for 'abline'
    LBRecap.custom.part: no visible global function definition for 'qnorm'
    Undefined global functions or variables:
     abline arms as.formula axis binomial coef density findbars fixef glm
     glmer logLik median na.omit optimize plot points qnorm quantile ranef
    Consider adding
     importFrom("graphics", "abline", "axis", "plot", "points")
     importFrom("stats", "as.formula", "binomial", "coef", "density", "glm",
     "logLik", "median", "na.omit", "optimize", "qnorm",
     "quantile")
    to your NAMESPACE file.
Flavors: r-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-debian-gcc, r-devel-linux-x86_64-fedora-clang, r-devel-linux-x86_64-fedora-gcc, r-devel-windows-ix86+x86_64, r-devel-windows-ix86+x86_64-gcc8, r-patched-linux-x86_64, r-patched-solaris-x86, r-release-linux-x86_64, r-release-windows-ix86+x86_64, r-release-osx-x86_64, r-oldrel-windows-ix86+x86_64, r-oldrel-osx-x86_64

Version: 0.1
Check: examples
Result: ERROR
    Running examples in 'BBRecapture-Ex.R' failed
    The error most likely occurred in:
    
    > base::assign(".ptime", proc.time(), pos = "CheckExEnv")
    > ### Name: BBRecap.custom.part
    > ### Title: Bayesian inference for behavioural effect models based on a
    > ### partition of the set of all partial capture histories
    > ### Aliases: BBRecap.custom.part
    > ### Keywords: Behavioural models Bayesian inference
    >
    > ### ** Examples
    >
    > data(greatcopper)
    > partition.Mc1=partition.ch(quant.binary,t=ncol(greatcopper),breaks=c(0,0.5,1))
    > mod.Mc1=BBRecap.custom.part(greatcopper,partition=partition.Mc1)
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
    :
     --- package (from environment) ---
    BBRecapture
     --- call from context ---
    BBRecap.custom.part(greatcopper, partition = partition.Mc1)
     --- call from argument ---
    if (!(class(data) == "data.frame" | class(data) == "matrix" |
     class(data) == "array" | class(data) == "table")) {
     stop("input data must be a data.frame or a matrix object or an array")
    }
     --- R stacktrace ---
    where 1: BBRecap.custom.part(greatcopper, partition = partition.Mc1)
    
     --- value of length: 2 type: logical ---
    [1] FALSE FALSE
     --- function from context ---
    function (data, last.column.count = FALSE, partition, neval = 1000,
     by.incr = 1, prior.N = c("Rissanen", "Uniform", "one.over.N",
     "one.over.N2"), output = c("base", "complete"))
    {
     prior.N = match.arg(prior.N)
     output = match.arg(output)
     prior = switch(prior.N, Rissanen = "Rissanen.prior", Uniform = "Uniform.prior",
     one.over.N = "1overN.prior", one.over.N2 = "1overN^2.prior")
     if (!(class(data) == "data.frame" | class(data) == "matrix" |
     class(data) == "array" | class(data) == "table")) {
     stop("input data must be a data.frame or a matrix object or an array")
     }
     if (class(data) == "table" | class(data) == "array") {
     n.occ = length(dim(data))
     mm = matrix(ncol = n.occ, nrow = 2^n.occ)
     for (i in 1:2^n.occ) {
     mm[i, ] = as.numeric(intToBits(i - 1) > 0)[1:n.occ]
     }
     data.vec = c(data)
     data[1] = 0
     dd = c()
     for (i in 1:length(data)) {
     dd = c(dd, rep(mm[i, ], data.vec[i]))
     }
     data.matrix = matrix(dd, ncol = length(dim(data)), byrow = T)
     }
     if (class(data.matrix) != "matrix") {
     data.matrix = as.matrix(data)
     }
     if (last.column.count) {
     if (any(data[, ncol(data)] < 0)) {
     stop("Last column must contain non negative frequencies/counts")
     }
     data = as.matrix(data)
     data.matrix = matrix(ncol = (ncol(data) - 1))
     for (i in 1:nrow(data)) {
     d = rep(data[i, 1:(ncol(data) - 1)], (data[i, ncol(data)]))
     dd = matrix(d, ncol = (ncol(data) - 1), byrow = T)
     data.matrix = rbind(data.matrix, dd)
     }
     data.matrix = data.matrix[-1, ]
     }
     if (any(data.matrix != 0 & data.matrix != 1))
     stop("data must be a binary matrix")
     if (sum(apply(data.matrix, 1, sum) == 0)) {
     warning("input data argument contains rows with all zeros: these rows will be removed and ignored")
     data.matrix = data.matrix[apply(data.matrix, 1, sum) !=
     0, ]
     }
     t = ncol(data.matrix)
     M = nrow(data.matrix)
     p.p = c()
     for (r in 1:length(partition)) {
     pp = unique(partition[[r]])
     p.p = c(p.p, pp)
     }
     p.p = sort(unique(p.p))
     cond1 = !all(sort(unlist(list.historylabels(ncol(data.matrix)))) ==
     p.p)
     cond2 = max(table(unlist(partition))) > 1
     if (cond1 | cond2)
     stop("The input argument 'partition' does not represent a partition of the set of all partial capture histories")
     prior.distr.N = function(x) {
     if (prior == "Rissanen.prior") {
     out = (rissanen(x))
     }
     if (prior == "Uniform.prior") {
     out = (1/(x^0))
     }
     if (prior == "1overN.prior") {
     out = (1/(x^1))
     }
     if (prior == "1overN^2.prior") {
     out = (1/(x^2))
     }
     return(out)
     }
     partial = pch(data.matrix)
     mm1 = matrix(NA, ncol = ncol(data.matrix), nrow = nrow(data.matrix))
     mm0 = matrix(NA, ncol = ncol(data.matrix), nrow = nrow(data.matrix))
     cc = c()
     n.obs.1 = c()
     n.obs.0 = c()
     n.unobs = c()
     log.post.N = c()
     post.N = c()
     vv = c()
     prior.inv.const = 0
     for (k in 1:length(partition)) {
     for (i in 1:nrow(data.matrix)) {
     for (j in 1:ncol(data.matrix)) {
     mm1[i, j] = any(partition[[k]] == partial[i,
     j]) & data.matrix[i, j] == 1
     mm0[i, j] = any(partition[[k]] == partial[i,
     j]) & data.matrix[i, j] == 0
     }
     }
     n.obs.0[k] = sum(mm0)
     n.obs.1[k] = sum(mm1)
     }
     for (k in 1:length(partition)) {
     for (j in 1:ncol(data.matrix)) {
     cc[j] = any(partition[[k]] == pch(matrix(rep(0, ncol(data.matrix)),
     nrow = 1))[j])
     }
     n.unobs[k] = sum(cc)
     }
     for (l in 1:neval) {
     val = seq(M, ((M + (neval - 1) * by.incr)), by = by.incr)
     nn.0 = n.obs.0 + (n.unobs * (l - 1) * by.incr)
     nn.1 = n.obs.1
     prior.inv.const = prior.inv.const + prior.distr.N((M +
     l - 1))
     log.post.N[l] = lchoose((sum(nn.1) + sum(nn.0))/t, M) +
     sum(lbeta((nn.1 + 1), (nn.0 + 1))) + log(prior.distr.N((M +
     l - 1)))
     }
     l.max = max(log.post.N)
     for (k in 1:neval) {
     vv[k] <- exp(log.post.N[k] - l.max)
     }
     ss = sum(vv)
     post.N = vv/ss
     ord = order(post.N, decreasing = T)
     p.max = ord[1]
     mode.N = val[p.max]
     mean.N <- round(sum(post.N * val))
     median.N = M
     g <- c()
     for (k in 1:neval) {
     g = c(g, post.N[k])
     if (sum(g) <= 0.5)
     median.N = median.N + 1
     }
     funzioneRMSE = function(x) {
     sum((((x/val) - 1)^2) * post.N)
     }
     estimate.N = round(optimize(funzioneRMSE, c(min(val), max(val)))$minimum)
     alpha <- 0.05
     g = 0
     d = 0
     aa = c()
     ordine <- order(post.N, decreasing = T)
     w <- val
     w <- w[ordine]
     p <- post.N
     p <- p[ordine]
     for (k in 1:neval) {
     if (g < (1 - alpha)) {
     g = g + p[k]
     d = d + 1
     }
     }
     aa <- w[1:d]
     inf.lim <- min(aa)
     sup.lim <- max(aa)
     log.marg.likelihood = log(sum(exp(log.post.N - max(log.post.N) -
     log(prior.inv.const)))) + max(log.post.N)
     out = switch(output, base = list(Prior.N = prior.N, N.hat.RMSE = estimate.N,
     HPD.N. = c(inf.lim, sup.lim), log.marginal.likelihood = log.marg.likelihood),
     complete = list(Prior.N = prior.N, N.hat.mean = mean.N,
     N.hat.median = median.N, N.hat.mode = mode.N, N.hat.RMSE = estimate.N,
     HPD.N = c(inf.lim, sup.lim), log.marginal.likelihood = log.marg.likelihood,
     N.range = val, posterior.N = post.N, Partition = partition))
     return(out)
    }
    <bytecode: 0x13800e88>
    <environment: namespace:BBRecapture>
     --- function search by body ---
    Function BBRecap.custom.part in namespace BBRecapture has this body.
     ----------- END OF FAILURE REPORT --------------
    Error in if (!(class(data) == "data.frame" | class(data) == "matrix" | :
     the condition has length > 1
    Calls: BBRecap.custom.part
    Execution halted
Flavor: r-devel-linux-x86_64-debian-clang