* using log directory ‘/data/gannet/ripley/R/packages/tests-LENGTH1/powerAnalysis.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 ‘powerAnalysis/DESCRIPTION’ ... OK * this is package ‘powerAnalysis’ 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 ‘powerAnalysis’ 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 ... OK * checking S3 generic/method consistency ... OK * checking replacement functions ... OK * checking foreign function calls ... OK * checking R code for possible problems ... [7s/20s] 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 examples ... ERROR Running examples in ‘powerAnalysis-Ex.R’ failed The error most likely occurred in: > ### Name: ES.chisq.assoc > ### Title: Compute effect size of chi-squared test of association > ### Aliases: ES.chisq.assoc > > ### ** Examples > > counts <- matrix(c(225,125,85,95),nrow=2,byrow=TRUE) > ES.chisq.assoc(ct=counts) ----------- FAILURE REPORT -------------- --- failure: length > 1 in coercion to logical --- --- srcref --- : --- package (from environment) --- powerAnalysis --- call from context --- ES.chisq.assoc(ct = counts) --- call from argument --- any(ct < 0) || is.na(ct) --- R stacktrace --- where 1: ES.chisq.assoc(ct = counts) --- value of length: 4 type: logical --- [,1] [,2] [1,] FALSE FALSE [2,] FALSE FALSE --- function from context --- function (ct = NULL, chisq = NULL, p = NULL, n = NULL, df = NULL, mindf = NULL) { phi = NULL if (!is.null(ct)) { row = nrow(ct) col = ncol(ct) if (any(ct < 0) || is.na(ct)) { stop("all entries of 'ct' must be nonnegative and finite") } if (row < 2 || col < 2) { stop("'ct' must have at least two rows and two columes") } df = (row - 1) * (col - 1) n = sum(ct) mindf <- ifelse(row > col, col - 1, row - 1) chisq = chisq.test(ct)$statistic[[1]] p = chisq.test(ct)$p.value phi = sqrt(chisq/(n * mindf)) } else if (!is.null(chisq)) { if (chisq < 0) { stop("chisq must be at least 0\n") } if (!is.null(n) && !is.null(df) && !is.null(mindf)) { if (n < 1) { stop("total number of observations must be at least 1\n") } if (df < 1) { stop("df must be at least 1\n") } if (mindf < 1) { stop("mindf must be at least 1") } p = pchisq(chisq, df, lower.tail = FALSE) phi = sqrt(chisq/(n * mindf)) } else { stop("n, df, and mindf are needed to calculate es(effect size)\n") } } else if (!is.null(p)) { if (p < 0 || p > 1) { stop("p must be in [0,1]\n") } if (!is.null(n) & !is.null(df) & !is.null(mindf)) { if (n < 1) { stop("total number of observations must be at least 1\n") } if (df < 1) { stop("df must be at least 1\n") } if (mindf < 1) { stop("mindf must be at least 1\n") } chisq = qchisq(p, df, lower.tail = FALSE) phi = sqrt(chisq/(n * mindf)) } else { stop("n, df, and mindf are needed to calculate es(effect size)\n") } } else { stop("one of ct, chisq and p is needed to calculate es(effect size)\n") } METHOD = "effect size of chi-squared test of association" large = 0.5 * sqrt(mindf) medium = 0.3 * sqrt(mindf) small = 0.1 * sqrt(mindf) NOTE1 = paste("small effect size: phi = ", small, sep = "") NOTE2 = paste(" medium effect size: phi = ", medium, sep = "") NOTE3 = paste(" large effect size: phi = ", large, sep = "") NOTE = paste(NOTE1, NOTE2, NOTE3, sep = "\n") structure(list(phi = phi, chisq = chisq, p = p, n = n, df = df, mindf = mindf, method = METHOD, note = NOTE), class = "power.htest") } --- function search by body --- Function ES.chisq.assoc in namespace powerAnalysis 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/powerAnalysis.Rcheck/00check.log’ for details. Command exited with non-zero status 1 Time 1:50.56, 30.57 + 5.82