* using log directory ‘/data/gannet/ripley/R/packages/tests-LENGTH1/ModelGood.Rcheck’ * using R Under development (unstable) (2022-04-03 r82074) * using platform: x86_64-pc-linux-gnu (64-bit) * using session charset: UTF-8 * using option ‘--no-stop-on-test-error’ * checking for file ‘ModelGood/DESCRIPTION’ ... OK * this is package ‘ModelGood’ version ‘1.0.9’ * 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 ‘ModelGood’ can be installed ... [7s/17s] 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 'library' or 'require' call to ‘glmnet’ in package code. Please use :: or requireNamespace() instead. See section 'Suggested packages' in the 'Writing R Extensions' manual. * checking S3 generic/method consistency ... OK * checking replacement functions ... OK * checking foreign function calls ... OK * checking R code for possible problems ... [14s/24s] NOTE AutoSelectLRM: no visible global function definition for ‘reformulate’ AutoSelectLRM: no visible global function definition for ‘glm’ Brier.list: no visible global function definition for ‘model.frame’ Brier.list: no visible binding for global variable ‘na.fail’ Brier.list: no visible global function definition for ‘model.response’ Brier.list : : no visible global function definition for ‘na.omit’ ConfScore : : : no visible global function definition for ‘sd’ Diagnose: no visible global function definition for ‘binom.test’ ElasticNet: no visible global function definition for ‘model.frame’ ElasticNet: no visible binding for global variable ‘na.omit’ ElasticNet: no visible global function definition for ‘terms.formula’ ElasticNet: no visible global function definition for ‘model.response’ ElasticNet: no visible global function definition for ‘model.matrix’ NPV: no visible global function definition for ‘binom.test’ PPV: no visible global function definition for ‘binom.test’ Roc.formula: no visible global function definition for ‘update.formula’ Roc.list : : no visible global function definition for ‘update.formula’ Roc.list: no visible global function definition for ‘model.frame’ Roc.list: no visible binding for global variable ‘na.fail’ Roc.list: no visible global function definition for ‘model.response’ Roc.list : : no visible global function definition for ‘na.omit’ Roc.list : : no visible global function definition for ‘approx’ Roc.list : : no visible binding for global variable ‘median’ Sensitivity: no visible global function definition for ‘binom.test’ Specificity: no visible global function definition for ‘binom.test’ TNR.numeric: no visible global function definition for ‘binom.test’ TNR.table: no visible global function definition for ‘binom.test’ TPR.numeric: no visible global function definition for ‘binom.test’ TPR.table: no visible global function definition for ‘binom.test’ avRoc : : no visible global function definition for ‘approx’ avRoc : : no visible binding for global variable ‘median’ calPlot2: no visible binding for global variable ‘na.fail’ calPlot2: no visible global function definition for ‘model.frame’ calPlot2: no visible global function definition for ‘model.response’ calPlot2 : : no visible global function definition for ‘quantile’ calPlot2 : : no visible global function definition for ‘na.omit’ calPlot2: no visible global function definition for ‘par’ calPlot2: no visible global function definition for ‘title’ calPlot2: no visible global function definition for ‘segments’ calPlot2 : : no visible global function definition for ‘col2rgb’ calPlot2 : : no visible global function definition for ‘points’ click.Roc: no visible global function definition for ‘xy.coords’ click.Roc: no visible global function definition for ‘identify’ click.Roc: no visible global function definition for ‘points’ click.Roc: no visible global function definition for ‘text’ plot.Roc: no visible global function definition for ‘abline’ plot.Roc: no visible global function definition for ‘gray’ plot.Roc: no visible global function definition for ‘par’ plot.confScore : : no visible global function definition for ‘points’ plot.confScore : : no visible global function definition for ‘lines’ plot.confScore: no visible global function definition for ‘legend’ plot.riskReclassification: no visible global function definition for ‘gray’ plot.riskReclassification: no visible global function definition for ‘axis’ plot.riskReclassification: no visible global function definition for ‘abline’ predictClassProb.autoElasticNet: no visible global function definition for ‘predict’ predictClassProb.mvr: no visible global function definition for ‘predict’ predictClassProb.randomForest: no visible global function definition for ‘predict’ predictStatusProb.ElasticNet: no visible global function definition for ‘model.frame’ predictStatusProb.ElasticNet: no visible binding for global variable ‘na.omit’ predictStatusProb.ElasticNet: no visible global function definition for ‘model.matrix’ predictStatusProb.ElasticNet: no visible global function definition for ‘predict’ predictStatusProb.formula: no visible global function definition for ‘update.formula’ predictStatusProb.formula: no visible global function definition for ‘model.frame’ predictStatusProb.formula: no visible global function definition for ‘glm’ predictStatusProb.glm: no visible global function definition for ‘predict’ predictStatusProb.lrm: no visible global function definition for ‘predict’ predictStatusProb.randomForest: no visible global function definition for ‘predict’ predictStatusProb.rfsrc: no visible global function definition for ‘predict’ predictStatusProb.rpart: no visible global function definition for ‘predict’ summary.Roc : : no visible global function definition for ‘quantile’ Undefined global functions or variables: abline approx axis binom.test col2rgb glm gray identify legend lines median model.frame model.matrix model.response na.fail na.omit par points predict quantile reformulate sd segments terms.formula text title update.formula xy.coords Consider adding importFrom("grDevices", "col2rgb", "gray", "xy.coords") importFrom("graphics", "abline", "axis", "identify", "legend", "lines", "par", "points", "segments", "text", "title") importFrom("stats", "approx", "binom.test", "glm", "median", "model.frame", "model.matrix", "model.response", "na.fail", "na.omit", "predict", "quantile", "reformulate", "sd", "terms.formula", "update.formula") to your NAMESPACE file. * checking Rd files ... NOTE checkRd: (7) file 'Roc.Rd': \item in \describe must have non-empty label * 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 line endings in C/C++/Fortran sources/headers ... OK * checking pragmas in C/C++ headers and code ... OK * checking compilation flags used ... OK * checking compiled code ... NOTE File ‘ModelGood/libs/ModelGood.so’: Found no calls to: ‘R_registerRoutines’, ‘R_useDynamicSymbols’ It is good practice to register native routines and to disable symbol search. See ‘Writing portable packages’ in the ‘Writing R Extensions’ manual. * checking examples ... [14s/22s] ERROR Running examples in ‘ModelGood-Ex.R’ failed The error most likely occurred in: > ### Name: Roc > ### Title: Comparing prediction models with Receiver operating > ### characteristics and Brier scores > ### Aliases: Brier Brier.glm Brier.list Brier.lrm Brier.randomForest > ### Brier.rpart Roc Roc.glm Roc.list Roc.lrm Roc.randomForest Roc.rpart > ### Keywords: models > > ### ** Examples > > ## Generate some data with binary response Y > ## depending on X1 and X2 and X1*X2 > set.seed(40) > N <- 40 > X1 <- rnorm(N) > X2 <- abs(rnorm(N,4)) > X3 <- rbinom(N,1,.4) > expit <- function(x) exp(x)/(1+exp(x)) > lp <- expit(-2 + X1 + X2 + X3 - X3*X2) > Y <- factor(rbinom(N,1,lp)) > dat <- data.frame(Y=Y,X1=X1,X2=X2) > > # single markers, one by one > r1 <- Roc(Y~X1,data=dat) > plot(r1,col=1) > r2 <- Roc(Y~X2,data=dat) > lines(r2,col=2) > > # or, directly multiple in one > r12 <- Roc(list(Y~X1,Y~X2),data=dat) > plot(r12) > > ## compare logistic regression > lm1 <- glm(Y~X1,data=dat,family="binomial") > lm2 <- glm(Y~X1+X2,data=dat,family="binomial") > r1=Roc(list(LR.X1=lm1,LR.X1.X2=lm2)) > summary(r1) Receiver operating characteristic Sample size: 40 Response: '0' (n=20) '1' (n=20) Area under the ROC curve (AUC, higher better): full data LR.X1 60.25 LR.X1.X2 60.25 Brier score (Brier, lower better): full data LR.X1.X2 23.85 LR.X1 24.38 > Brier(list(lm1,lm2)) Sample size: 40 Estimated Brier score in % apparent glm.1 23.85 glm 24.38 Either newdata or apparent (learn data) performance. > > # machine learning > library(randomForest) randomForest 4.7-1 Type rfNews() to see new features/changes/bug fixes. > dat$Y=factor(dat$Y) > rf <- randomForest(Y~X2,data=dat) > rocCV=Roc(list(RandomForest=rf,LogisticRegression=lm2), + data=dat, + splitMethod="bootcv", + B=3, + cbRatio=1) ----------- FAILURE REPORT -------------- --- failure: length > 1 in coercion to logical --- --- srcref --- : --- package (from environment) --- ModelGood --- call from context --- FUN(X[[i]], ...) --- call from argument --- SplitMethod != "noinf" && is.null(fit$call) --- R stacktrace --- where 1: FUN(X[[i]], ...) where 2: lapply(1:length(object), function(f) { fit <- object[[f]] if (SplitMethod != "noinf" && is.null(fit$call)) stop(paste("Element", f, " '", names(object)[f], "' does not have a call argument\nThis is needed to rebuild the model during cross-validation.")) else fit$call$data <- NULL }) where 3: MgCheck(object = object, model.args = model.args, model.parms = model.parms, SplitMethod = SplitMethod, verbose = verbose) where 4: Roc.list(list(RandomForest = rf, LogisticRegression = lm2), data = dat, splitMethod = "bootcv", B = 3, cbRatio = 1) where 5: Roc(list(RandomForest = rf, LogisticRegression = lm2), data = dat, splitMethod = "bootcv", B = 3, cbRatio = 1) --- value of length: 6 type: logical --- name internal.name k B M TRUE TRUE TRUE TRUE TRUE N TRUE --- function from context --- function (f) { fit <- object[[f]] if (SplitMethod != "noinf" && is.null(fit$call)) stop(paste("Element", f, " '", names(object)[f], "' does not have a call argument\nThis is needed to rebuild the model during cross-validation.")) else fit$call$data <- NULL } --- function search by 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, 4 NOTEs See ‘/data/gannet/ripley/R/packages/tests-LENGTH1/ModelGood.Rcheck/00check.log’ for details. Command exited with non-zero status 1 Time 1:57.58, 57.16 + 7.68