* using log directory ‘/data/gannet/ripley/R/packages/tests-LENGTH1/DynamicDistribution.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 ‘DynamicDistribution/DESCRIPTION’ ... OK * this is package ‘DynamicDistribution’ version ‘1.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 ‘DynamicDistribution’ can be installed ... [7s/19s] 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 ... [15s/47s] NOTE Beta_dis: no visible global function definition for ‘integrate’ Cauchy: no visible global function definition for ‘integrate’ Chi_Square: no visible global function definition for ‘integrate’ DynCon: no visible global function definition for ‘dev.hold’ DynCon: no visible global function definition for ‘par’ DynCon: no visible global function definition for ‘grid’ DynCon: no visible global function definition for ‘polygon’ DynCon: no visible global function definition for ‘legend’ DynCon: no visible global function definition for ‘title’ DynCon: no visible global function definition for ‘dev.interactive’ DynCon: no visible global function definition for ‘dev.flush’ DynDis: no visible global function definition for ‘dev.hold’ DynDis: no visible global function definition for ‘par’ DynDis: no visible global function definition for ‘grid’ DynDis: no visible global function definition for ‘points’ DynDis: no visible global function definition for ‘legend’ DynDis: no visible global function definition for ‘segments’ DynDis: no visible global function definition for ‘title’ DynDis: no visible global function definition for ‘dev.interactive’ DynDis: no visible global function definition for ‘dev.flush’ Exponential: no visible global function definition for ‘integrate’ F_dis: no visible global function definition for ‘integrate’ Gamma_dis: no visible global function definition for ‘pgamma’ Inverse_Gaussian: no visible global function definition for ‘integrate’ Laplace: no visible global function definition for ‘integrate’ Lognormal: no visible global function definition for ‘integrate’ Normal: no visible global function definition for ‘pnorm’ Pareto: no visible global function definition for ‘integrate’ Rayleigh: no visible global function definition for ‘integrate’ Student_t: no visible global function definition for ‘integrate’ Undefined global functions or variables: dev.flush dev.hold dev.interactive grid integrate legend par pgamma pnorm points polygon segments title Consider adding importFrom("grDevices", "dev.flush", "dev.hold", "dev.interactive") importFrom("graphics", "grid", "legend", "par", "points", "polygon", "segments", "title") importFrom("stats", "integrate", "pgamma", "pnorm") 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 LazyData ... NOTE 'LazyData' is specified without a 'data' directory * checking examples ... [42s/88s] ERROR Running examples in ‘DynamicDistribution-Ex.R’ failed The error most likely occurred in: > ### Name: DynDis > ### Title: Dynamically Visualized Discrete Probability Distributions and > ### Their Moments > ### Aliases: DynDis > > ### ** Examples > > DynDis(name=Negative_Binomial,par_matrix=matrix(c(1,12,0.1,0.9),2,2) + ,choice='Kurtosis',const_par=c(4,0.7)) ----------- FAILURE REPORT -------------- --- failure: length > 1 in coercion to logical --- --- srcref --- : --- package (from environment) --- DynamicDistribution --- call from context --- name(para = Para, const_par = const_par) --- call from argument --- p <= 0 || p >= 1 --- R stacktrace --- where 1: name(para = Para, const_par = const_par) where 2: DynDis(name = Negative_Binomial, par_matrix = matrix(c(1, 12, 0.1, 0.9), 2, 2), choice = "Kurtosis", const_par = c(4, 0.7)) --- value of length: 100 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 --- function from context --- function (k = NULL, para, const_par) { r <- para[1, ] p <- para[2, ] const_par = const_par if (any(r <= 0) || any(p <= 0 || p >= 1)) stop("Error! The parameter r must be positive integer and p must be positive and less than 1!") if (const_par[1] <= 0 || (const_par[2] <= 0 || const_par[2] >= 1)) stop("Error! The constant parameter r must be positive integer and p must be positive and less than 1!") if (!is.numeric(k)) { Mode_seq1 <- floor((r - 1) * (1 - const_par[2])/const_par[2]) Mode_seq2 <- floor((const_par[1] - 1) * (1 - p)/p) y_max1 <- max((choose(r + Mode_seq1 - 1, Mode_seq1)) * (const_par[2]^r) * ((1 - const_par[2])^Mode_seq1)) y_max2 <- max((choose(const_par[1] + Mode_seq2 - 1, Mode_seq2)) * (p^const_par[1]) * ((1 - p)^Mode_seq2)) return(c(0, 2 * max(Mode_seq1), y_max1, 0, 2 * max(Mode_seq2), y_max2)) } if (is.numeric(k)) { density <- (choose(r + k - 1, k)) * (p^r) * ((1 - p)^k) fun <- function(k) { (choose(r + k - 1, k)) * (p^r) * ((1 - p)^k) } cdf <- c() for (i in k) { cdf <- c(cdf, sum(fun(0:i))) } Mean <- r * (1 - p)/p Variance <- r * (1 - p)/(p^2) Mode <- floor((r - 1) * (1 - p)/p) Skewness <- (2 - p)/((r * (1 - p))^0.5) Kurtosis <- 3 + 6/r + (p^2)/(r * (1 - p)) return(list(density = density, cdf = cdf, Mean = Mean, Variance = Variance, Mode = Mode, Skewness = Skewness, Kurtosis = Kurtosis, r = r, "r", p = p, "p", "Negative Binomial Distribution")) } } --- function search by body --- Function Negative_Binomial in namespace DynamicDistribution 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/DynamicDistribution.Rcheck/00check.log’ for details. Command exited with non-zero status 1 Time 3:37.08, 80.84 + 7.11