* using log directory ‘/data/gannet/ripley/R/packages/tests-LENGTH1/fgof.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 ‘fgof/DESCRIPTION’ ... OK * checking extension type ... Package * this is package ‘fgof’ version ‘0.2-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 ‘fgof’ can be installed ... [4s/11s] 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 ... NOTE Packages in Depends field not imported from: ‘mvtnorm’ ‘numDeriv’ These packages need to be imported from (in the NAMESPACE file) for when this namespace is loaded but not attached. * checking S3 generic/method consistency ... OK * checking replacement functions ... OK * checking foreign function calls ... OK * checking R code for possible problems ... [7s/19s] NOTE dmymvnorm: no visible global function definition for ‘dmvnorm’ dmymvt: no visible global function definition for ‘dmvt’ gof.test: no visible global function definition for ‘quantile’ gof.test : ecdf: no visible global function definition for ‘mecdf’ gof.test: no visible global function definition for ‘jacobian’ gof.test: no visible global function definition for ‘var’ gradCdfT: no visible global function definition for ‘dt’ gradCdfT: no visible global function definition for ‘pt’ gradCdfT: no visible global function definition for ‘pmvt’ influFun: no visible global function definition for ‘jacobian’ mult.sim: no visible global function definition for ‘rnorm’ plackettFormula: no visible global function definition for ‘pt’ plackettFormula: no visible global function definition for ‘pmvt’ pmymvnorm: no visible global function definition for ‘GenzBretz’ pmymvnorm: no visible global function definition for ‘TVPACK’ pmymvnorm : : no visible global function definition for ‘pmvnorm’ pmymvt: no visible global function definition for ‘GenzBretz’ pmymvt: no visible global function definition for ‘TVPACK’ pmymvt : : no visible global function definition for ‘pmvt’ rmymvnorm: no visible global function definition for ‘rmvnorm’ rmymvt: no visible global function definition for ‘rmvt’ Undefined global functions or variables: GenzBretz TVPACK dmvnorm dmvt dt jacobian mecdf pmvnorm pmvt pt quantile rmvnorm rmvt rnorm var Consider adding importFrom("stats", "dt", "pt", "quantile", "rnorm", "var") to your NAMESPACE file. * 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 examples ... ERROR Running examples in ‘fgof-Ex.R’ failed The error most likely occurred in: > ### Name: gof.test > ### Title: One Sample Goodness-of-fit Test > ### Aliases: gof.test > ### Keywords: htest > > ### ** Examples > > set.seed(123) > > n <- 200 > x <- rlnorm(200, 1, 1) > > system.time(m1 <- gof.test(x, "lnorm", 1000, list(meanlog=1, sdlog=1), simulation="pb")) ----------- FAILURE REPORT -------------- --- failure: length > 1 in coercion to logical --- --- srcref --- : --- package (from environment) --- fgof --- call from context --- gof.test(x, "lnorm", 1000, list(meanlog = 1, sdlog = 1), simulation = "pb") --- call from argument --- dim == 1 && qgrid == "fitted" --- R stacktrace --- where 1: gof.test(x, "lnorm", 1000, list(meanlog = 1, sdlog = 1), simulation = "pb") where 2: system.time(m1 <- gof.test(x, "lnorm", 1000, list(meanlog = 1, sdlog = 1), simulation = "pb")) --- value of length: 2 type: logical --- [1] FALSE TRUE --- function from context --- function (x, distr, nsim, start, simulation = c("mult", "pb"), ng = 1000, qgrid = c("empirical", "fitted"), gridStat = NULL, method.args = gradControl(), derCdfWrtPar = NULL, derLogPdfWrtPar = NULL, ...) { n <- NROW(x) dim <- NCOL(x) if (is.null(gridStat)) gridStat <- if (dim == 1) TRUE else FALSE rdistr <- get(paste("r", distr, sep = ""), mode = "function") pdistr <- get(paste("p", distr, sep = ""), mode = "function") ddistr <- get(paste("d", distr, sep = ""), mode = "function") if (dim == 1 && qgrid == "fitted") qdistr <- get(paste("q", distr, sep = ""), mode = "function") if (!is.matrix(x)) x <- as.matrix(x) fit <- findMLE(x, ddistr, start, ...) thetahat <- fit$estimate p <- length(thetahat) log.arg <- "log" %in% names(formals(ddistr)) rdistr.call <- parse(text = paste("rdistr(n, ", paste("theta[", 1L:p, "]", collapse = ", "), ")")) pdistr.call <- parse(text = paste("pdistr(x, ", paste("theta[", 1L:p, "]", collapse = ", "), ")")) ddistr.call <- if (log.arg) parse(text = paste("ddistr(x, ", paste("theta[", 1L:p, "]", collapse = ", "), ", log = TRUE)")) else parse(text = paste("log( ddistr(x, ", paste("theta[", 1L:p, "]", collapse = ", "), "))")) qdistr.call <- parse(text = paste("qdistr(p, ", paste("theta[", 1L:p, "]", collapse = ", "), ")")) findMLE.call <- if (dim == 1) parse(text = paste("findMLE(x, ddistr, start = as.list(theta), ...)")) else parse(text = paste("findMLE(x, ddistr, start = list(param=theta), ...)")) dots <- names(list(...)) pf <- formals(pdistr) pf.args <- names(pf) pf.m <- match(pf.args, dots) pf.m <- match(pf.args, dots) pf.m <- pf.m[!is.na(pf.m)] pdistr.my <- function(x, parm) { if (dim == 1) { ret <- eval(pdistr.call, list(theta = parm, x = x)) } else { formals(pdistr)[names(list(...)[pf.m])] <- list(...)[pf.m] ret <- pdistr(x, parm) } ret } ddistr.my <- function(x, parm) { if (dim == 1) { ret <- eval(ddistr.call, list(theta = parm, x = x)) } else { formals(ddistr)[names(list(...)[pf.m])] <- list(...)[pf.m] if (log.arg) ret <- ddistr(x, parm, log = TRUE) else ret <- log(ddistr(x, parm)) } ret } rdistr.my <- function(n, parm) { if (dim == 1) { ret <- eval(rdistr.call, list(theta = parm, n = n)) } else { formals(rdistr)[names(list(...)[pf.m])] <- list(...)[pf.m] formals(rdistr)$dim <- dim ret <- rdistr(n, parm) } ret } xg <- NULL if (gridStat) { ng1 <- ceiling(ng^(1/dim)) pgrid <- (1:ng1)/(ng1 + 1) if (dim == 1 && qgrid == "fitted") { xglist <- eval(qdistr.call, list(theta = thetahat, p = pgrid)) xg <- as.matrix(expand.grid(xglist)) } else { xglist <- list() for (i in 1:NCOL(x)) xglist[[i]] <- quantile(x[, i], prob = pgrid) xg <- as.matrix(expand.grid(xglist)) } } if (dim > 1) ecdf <- function(x) mecdf(x, expand = NA, continuous = FALSE) Fn <- ecdf(x) Ftheta <- function(x) pdistr.my(x, thetahat) stat <- getStat(x, n, Fn, Ftheta) names(stat) <- c("ksa", "cvma") if (gridStat) { stat <- c(getStat(xg, n, Fn, Ftheta), stat) names(stat) <- c("ks", "cvm", "ksa", "cvma") } pb <- function() { x.sim <- rdistr.my(n, thetahat) theta.sim <- eval(findMLE.call, list(theta = thetahat, x = x.sim))$estimate Fn.sim <- ecdf(x.sim) Ftheta.sim <- function(x) pdistr.my(x, theta.sim) stat <- getStat(x.sim, n, Fn.sim, Ftheta.sim) if (gridStat) { stat <- c(getStat(xg, n, Fn.sim, Ftheta.sim), stat) } stat } logdens <- function(theta) ddistr.my(x, theta) llk <- function(theta) sum(logdens(theta)) if (simulation == "pb") stat.sim <- replicate(nsim, pb()) else { if (is.null(derLogPdfWrtPar)) grad <- jacobian(logdens, thetahat, method.args = method.args) else grad <- derLogPdfWrtPar(thetahat, x) psi <- solve(var(grad), t(grad)) stat.sim <- mult.sim(xg, x, pdistr.my, ddistr.my, thetahat, psi, nsim, gridStat = gridStat, method.args = method.args, derCdfWrtPar = derCdfWrtPar) } p.value <- rowSums(stat.sim >= stat)/(nsim + 1) list(statistic = stat, p.value = p.value, estimate = thetahat, stat.sim = stat.sim) } --- function search by body --- Function gof.test in namespace fgof 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, 2 NOTEs See ‘/data/gannet/ripley/R/packages/tests-LENGTH1/fgof.Rcheck/00check.log’ for details. Command exited with non-zero status 1 Time 1:37.64, 29.56 + 5.45