* using log directory ‘/data/gannet/ripley/R/packages/tests-LENGTH1/LICORS.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 ‘LICORS/DESCRIPTION’ ... OK * checking extension type ... Package * this is package ‘LICORS’ version ‘0.2.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 ‘LICORS’ can be installed ... [21s/52s] OK * checking package 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 ... [34s/84s] NOTE embed2: no visible global function definition for ‘embed’ estimate_LC_pdf_state: no visible global function definition for ‘quantile’ estimate_LC_pdf_state: no visible global function definition for ‘bw.nrd0’ estimate_LC_pdf_state: no visible global function definition for ‘sd’ estimate_LC_pdf_state: no visible global function definition for ‘cov.wt’ estimate_LC_pdf_state: no visible binding for global variable ‘sd’ estimate_LC_pdf_state: no visible global function definition for ‘dnorm’ estimate_LC_pdf_state: no visible global function definition for ‘cov’ estimate_LC_pdf_state: no visible binding for global variable ‘median’ estimate_LC_pdf_state: no visible global function definition for ‘huge.select’ estimate_LC_pdf_state: no visible global function definition for ‘huge’ estimate_state_adj_matrix: no visible global function definition for ‘ks.test’ image2: no visible global function definition for ‘par’ image2: no visible global function definition for ‘colorRampPalette’ image2: no visible global function definition for ‘layout’ image2: no visible global function definition for ‘box’ image2: no visible global function definition for ‘axis’ image2: no visible global function definition for ‘mtext’ image2: no visible global function definition for ‘lines’ kmeanspp: no visible global function definition for ‘cov’ kmeanspp: no visible global function definition for ‘kmeans’ make_legend: no visible global function definition for ‘colorRampPalette’ make_legend: no visible global function definition for ‘axis’ make_legend: no visible global function definition for ‘mtext’ make_legend: no visible global function definition for ‘box’ mixed_LICORS: no visible global function definition for ‘cor’ mv_wKDE: no visible global function definition for ‘predict’ normalize: no visible global function definition for ‘is’ plot.LC: no visible global function definition for ‘box’ plot.LC: no visible global function definition for ‘abline’ plot.LC: no visible global function definition for ‘axis’ plot.LC: no visible global function definition for ‘grid’ plot.LC: no visible global function definition for ‘points’ plot.LC: no visible global function definition for ‘text’ plot.LC: no visible global function definition for ‘plot.new’ plot.LC: no visible global function definition for ‘legend’ plot.mixed_LICORS: no visible global function definition for ‘par’ plot.mixed_LICORS: no visible global function definition for ‘colorRampPalette’ plot.mixed_LICORS: no visible global function definition for ‘layout’ plot.mixed_LICORS: no visible global function definition for ‘matplot’ plot.mixed_LICORS: no visible global function definition for ‘box’ plot.mixed_LICORS: no visible global function definition for ‘axis’ plot.mixed_LICORS: no visible global function definition for ‘abline’ plot.mixed_LICORS: no visible global function definition for ‘mtext’ plot.mixed_LICORS: no visible global function definition for ‘legend’ plot.mixed_LICORS: no visible global function definition for ‘barplot’ plot.mixed_LICORS: no visible global function definition for ‘ts.plot’ plot.mixed_LICORS: no visible global function definition for ‘ts’ plot.mixed_LICORS: no visible global function definition for ‘lines’ plot.mixed_LICORS: no visible global function definition for ‘plot.new’ plot.mixed_LICORS: no visible global function definition for ‘plot.window’ plot.mixed_LICORS: no visible global function definition for ‘rect’ predict_FLC_given_PLC : : no visible binding for global variable ‘median’ rdensity: no visible global function definition for ‘rnorm’ search_knn: no visible global function definition for ‘ann’ wKDE: no visible global function definition for ‘na.omit’ wKDE: no visible global function definition for ‘bw.nrd’ wKDE: no visible global function definition for ‘quantile’ wKDE: no visible global function definition for ‘density’ wKDE: no visible global function definition for ‘approx’ Undefined global functions or variables: abline ann approx axis barplot box bw.nrd bw.nrd0 colorRampPalette cor cov cov.wt density dnorm embed grid huge huge.select is kmeans ks.test layout legend lines matplot median mtext na.omit par plot.new plot.window points predict quantile rect rnorm sd text ts ts.plot Consider adding importFrom("grDevices", "colorRampPalette") importFrom("graphics", "abline", "axis", "barplot", "box", "grid", "layout", "legend", "lines", "matplot", "mtext", "par", "plot.new", "plot.window", "points", "rect", "text") importFrom("methods", "is") importFrom("stats", "approx", "bw.nrd", "bw.nrd0", "cor", "cov", "cov.wt", "density", "dnorm", "embed", "kmeans", "ks.test", "median", "na.omit", "predict", "quantile", "rnorm", "sd", "ts", "ts.plot") to your NAMESPACE file (and ensure that your DESCRIPTION Imports field contains 'methods'). * 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 data for ASCII and uncompressed saves ... OK * checking examples ... [10s/25s] ERROR Running examples in ‘LICORS-Ex.R’ failed The error most likely occurred in: > ### Name: estimate_LC_pdfs > ### Title: Estimate PLC/FLC distributions for all states > ### Aliases: estimate_LC_pdfs estimate_LC_pdf_state estimate_LC.pdf.state > ### Keywords: distribution multivariate nonparametric > > ### ** Examples > > set.seed(10) > WW <- matrix(runif(10000), ncol = 10) > WW <- normalize(WW) > temp_flcs <- cbind(sort(rnorm(nrow(WW)))) > temp_flc_pdfs <- estimate_LC_pdfs(temp_flcs, WW) ----------- FAILURE REPORT -------------- --- failure: length > 1 in coercion to logical --- --- srcref --- : --- package (from environment) --- LICORS --- call from context --- estimate_LC_pdf_state(state = ii, states = states, weights = weight.matrix[, ii], eval.LCs = eval.LCs, LCs = LCs, method = method) --- call from argument --- is.null(weights) || is.na(weights) --- R stacktrace --- where 1: estimate_LC_pdf_state(state = ii, states = states, weights = weight.matrix[, ii], eval.LCs = eval.LCs, LCs = LCs, method = method) where 2: estimate_LC_pdfs(temp_flcs, WW) --- value of length: 1000 type: logical --- [1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [13] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [25] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [37] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [49] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [61] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [73] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [85] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [97] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [109] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [121] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [133] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [145] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [157] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [169] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [181] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [193] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [205] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [217] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [229] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [241] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [253] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [265] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [277] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [289] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [301] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [313] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [325] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [337] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [349] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [361] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [373] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [385] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [397] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [409] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [421] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [433] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [445] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [457] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [469] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [481] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [493] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [505] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [517] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [529] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [541] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [553] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [565] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [577] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [589] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [601] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [613] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [625] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [637] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [649] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [661] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [673] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [685] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [697] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [709] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [721] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [733] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [745] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [757] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [769] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [781] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [793] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [805] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [817] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [829] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [841] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [853] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [865] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [877] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [889] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [901] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [913] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [925] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [937] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [949] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [961] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [973] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [985] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [997] FALSE FALSE FALSE FALSE --- function from context --- function (state, states = NULL, weights = NULL, LCs = NULL, eval.LCs = NULL, method = c("nonparametric", "normal", "huge")) { method <- match.arg(method) if (is.null(LCs)) { stop("You have to provide data (LCs) to estimate the densities.") } else { LCs <- cbind(LCs) } if (is.null(eval.LCs)) { eval.LCs <- LCs } else { eval.LCs <- cbind(eval.LCs) } num.states <- ncol(eval.LCs) if (is.null(states) && is.null(weights)) { stop("Either provide state assignment or weights.") } if (is.matrix(weights)) { states <- weight_matrix2states(weights) weights <- weights[, state] if (any(is.na(weights/sum(weights)))) { stop(paste0("All weights are 0; normalizing introduces 'NA'. \n Please remove state", state, ".")) } } in.current.state <- which(states == state) LCs.in.current.state <- LCs[in.current.state, ] if (is.null(weights)) { effective.sample.size <- length(in.current.state) } else { effective.sample.size <- sum(weights) } if (length(in.current.state) < 5) { in.current.state <- which(weights >= quantile(weights, 0.95)) } if (length(in.current.state) < 5) { optimal.bw <- 0.1 } else { optimal.bw <- bw.nrd0(c(LCs)[in.current.state]) } if (num.states == 1) { switch(method, nonparametric = { if (is.null(weights) || is.na(weights)) { LC.pdf.state <- wKDE(LCs.in.current.state, eval.points = eval.LCs, weights = NULL, bw = optimal.bw) } else { LC.pdf.state <- wKDE(LCs, eval.points = eval.LCs, weights = weights/sum(weights), bw = optimal.bw) } }, normal = { if (is.null(weights) || is.na(weights)) { mu <- mean(LCs.in.current.state) sigma <- sd(c(LCs.in.current.state)) } else { temp <- cov.wt(LCs, wt = weights, method = "ML") mu <- temp$center sigma <- sqrt(temp$cov) rm(temp) } if (effective.sample.size < 5) { sigma <- apply(LCs, 2, sd) } LC.pdf.state <- dnorm(c(eval.LCs), mean = mu, sd = sigma) }) } else { switch(method, nonparametric = { stop("Multivariate nonparametrc not implemented yet.") if (is.null(weights) || is.na(weights)) { LC.pdf.state <- mv_wKDE(LCs.in.current.state, eval.points = eval.LCs) } else { LC.pdf.state <- mv_wKDE(LCs, eval.points = eval.LCs, weights = weights/sum(weights)) } }, normal = { if (effective.sample.size < 5) { Sigma.mat <- cov(LCs) mu.vec <- apply(LCs, 2, median) } else { if (is.null(weights) || is.na(weights)) { mu.vec <- colMeans(LCs.in.current.state) Sigma.mat <- cov(LCs.in.current.state) } else { temp <- cov.wt(LCs, wt = weights, method = "ML") mu.vec <- temp$center Sigma.mat <- temp$cov rm(temp) } } Sigma.mat <- Sigma.mat + 1/100 * mean(diag(Sigma.mat)) * diag(1, ncol(Sigma.mat)) LC.pdf.state <- dmvnorm(eval.LCs, mean = mu.vec, sigma = Sigma.mat) }, huge = { glasso.est <- huge.select(huge(LCs.in.current.state, cov.output = TRUE, method = "glasso", verbose = FALSE), verbose = FALSE) LC.pdf.state <- dmvnorm(eval.LCs, mean = apply(LCs.in.current.state, 2, median), sigma = as.matrix(glasso.est$opt.cov)) }) } LC.pdf.state[is.na(LC.pdf.state)] <- .Machine$double.eps^0.5 invisible(LC.pdf.state) } --- function search by body --- Function estimate_LC_pdf_state in namespace LICORS 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, 1 NOTE See ‘/data/gannet/ripley/R/packages/tests-LENGTH1/LICORS.Rcheck/00check.log’ for details. Command exited with non-zero status 1 Time 6:47.12, 154.88 + 14.16