* using log directory 'd:/RCompile/CRANincoming/R-devel/easyViz.Rcheck' * using R Under development (unstable) (2026-01-07 r89288 ucrt) * using platform: x86_64-w64-mingw32 * R was compiled by gcc.exe (GCC) 14.3.0 GNU Fortran (GCC) 14.3.0 * running under: Windows Server 2022 x64 (build 20348) * using session charset: UTF-8 * checking for file 'easyViz/DESCRIPTION' ... OK * this is package 'easyViz' version '2.0.0' * package encoding: UTF-8 * checking CRAN incoming feasibility ... NOTE Maintainer: 'Luca Corlatti ' Possibly misspelled words in DESCRIPTION: Cribari (16:17) Neto (16:25) * 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 hidden files and directories ... OK * checking for portable file names ... OK * checking serialization versions ... OK * checking whether package 'easyViz' can be installed ... OK * checking installed package size ... OK * checking package directory ... OK * checking for future file timestamps ... 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 code 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 ... [10s] 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 'easyViz-Ex.R' failed The error most likely occurred in: > base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: easyViz > ### Title: Easy Visualization of Conditional Effects from Regression Models > ### Aliases: easyViz > > ### ** Examples > > #------------------------------------------ > # Load required packages > #------------------------------------------ > > library(MASS) > library(nlme) > library(betareg) > library(survival) > library(lme4) Loading required package: Matrix Attaching package: 'lme4' The following object is masked from 'package:nlme': lmList > library(glmmTMB) > library(mgcv) This is mgcv 1.9-4. For overview type '?mgcv'. > > #------------------------------------------ > # Simulate dataset > #------------------------------------------ > set.seed(123) > n <- 100 > x1 <- rnorm(n) > x2 <- rnorm(n) > x3 <- runif(n, 0, 5) > x4 <- factor(sample(letters[1:3], n, replace = TRUE)) > group_levels <- paste0("G", 1:10) > group <- factor(sample(group_levels, n, replace = TRUE)) > > # Generate random intercepts for each group > group_effects <- rnorm(length(group_levels), mean = 0, sd = 2) # non-zero variance > names(group_effects) <- group_levels > group_intercept <- group_effects[as.character(group)] > > # Non-linear continuous response > true_y <- 5 * sin(x3) + 3 * x1 + group_intercept + model.matrix(~x4)[, -1] %*% c(2, -2) > noise <- rnorm(n, sd = 3) > y <- as.vector(true_y + noise) > > # Binary response with group effect added to logit > logit_p <- 2 * x1 - 1 + group_intercept > p <- 1 / (1 + exp(-logit_p)) > binary_y <- rbinom(n, size = 1, prob = p) > > # Binomial response: number of successes and failures > y3 <- sample(10:30, n, replace = TRUE) > logit_p_prop <- -1.5 * scale(x1) > p_prop <- 1 / (1 + exp(-logit_p_prop)) > y1 <- rbinom(n, size = y3, prob = p_prop) # successes > y2 <- y3 - y1 # failures > > # Count response with group effect in log(mu) > mu_count <- exp(1 + 0.8 * x2 - 0.5 * (x4 == "b") + group_intercept) > size <- 1.2 > count_y <- rnbinom(n, size = size, mu = mu_count) > # Offset variable > offset_var <- runif(n, 1, 10) > > # Assemble dataset > sim.data <- data.frame(x1, x2, x3, x4, group, y, binary_y, y1, y2, y3, count_y, offset_var) > > #------------------------------------------ > # 1. Linear model (lm) > #------------------------------------------ > mod.lm <- lm(y ~ x1 + x4, + data = sim.data) > easyViz(model = mod.lm, data = sim.data, predictor = "x1", + by = "x4", + pred_range_limit = FALSE, + pred_on_top = TRUE, + ylim = c(-12,18), + xlab = "Predictor x1", + ylab = "Response y", + point_col = ifelse(sim.data$x4=="a", "red", + ifelse(sim.data$x4=="b", "orange", + "yellow")), + point_cex = 0.5, + pred_line_col = c("red", "orange", "yellow"), + pred_line_lty = 1, + ci_polygon_col = c(rgb(1,0,0,0.5), + rgb(1,0.5,0,0.5), + rgb(1,1,0,0.5))) > > mod.lm2 <- lm(sqrt(x3) ~ x1 * x4, + data = sim.data) > easyViz(model = mod.lm2, data = sim.data, predictor = "x1", + by="x4", + backtransform_response = function(x) x^2, + ylim = c(0,8), + show_data_points = FALSE, + show_conditioning = TRUE) Prediction conditioning summary - Held fixed: none - Varied in prediction grid: x1, x4 > > mod.lm3 <- lm(y ~ poly(x3, 3), + data = sim.data) > easyViz(model = mod.lm3, data = sim.data, predictor = "x3", + pred_on_top = TRUE, + font_family = "mono", + point_col = rgb(1,0,0,0.3), + point_pch = "+", + ci_level = 0.85, + ci_type = "lines", + ci_line_lty = 2) > > # Extract prediction data > pred.df <- easyViz(model = mod.lm, data = sim.data, predictor = "x1", + by = "x4", ci_level = 0.85, plot = FALSE) > head(pred.df) x1 x4 fit 85lcl 85ucl 1 -1.966617 a -2.837348 -5.074907 -0.5997897 2 -1.929082 a -2.746961 -4.961273 -0.5326492 3 -1.891547 a -2.656574 -4.847855 -0.4652929 4 -1.854011 a -2.566187 -4.734659 -0.3977141 5 -1.816476 a -2.475799 -4.621693 -0.3299056 6 -1.778941 a -2.385412 -4.508964 -0.2618601 > > #------------------------------------------ > # 2. Robust linear model (rlm) > #------------------------------------------ > mod.rlm <- rlm(y ~ x1 + x4, + data = sim.data) > old_xpd_mar <- par(xpd = TRUE, mar = c(5.1, 4.1, 4.1, 5.1)) > easyViz(model = mod.rlm, data = sim.data, predictor = "x1", + by = "x4", + pred_on_top = TRUE, + bty = "n", + xlab = "Predictor x1", + ylab = "Response y", + point_col = ifelse(sim.data$x4=="a", "red", + ifelse(sim.data$x4=="b", "orange", + "yellow")), + point_cex = 0.5, + pred_line_col = c("red", "orange", "yellow"), + pred_line_lty = 1, + ci_polygon_col = c(rgb(1,0,0), + rgb(1,0.5,0), + rgb(1,1,0)), + ci_polygon_alpha = 0.4, + legend_position = c(2.25,13), + legend_title = "Predictor x4", + legend_title_size = 0.9, + legend_args = list(legend = c("a", "b", "c", + "a", "b", "c"), + col = c("red", "orange", "yellow", + "red", "orange", "yellow"), + lty = c(1, 1, 1, NA, NA, NA), + lwd = c(2, 2, 2, NA, NA, NA), + pch = c(NA, NA, NA, 16, 16, 15), + cex = 0.75, + bty = "n")) Robust standard errors for rlm model computed using: HC0 > par(old_xpd_mar) > > #------------------------------------------ > # 3. Generalized least squares (gls) > #------------------------------------------ > mod.gls <- gls(y ~ x1 + x2 + x4, + correlation = corAR1(form = ~1|group), + data = sim.data) > easyViz(model = mod.gls, data = sim.data, predictor = "x4", + jitter_data_points = TRUE, + bty = "n", + xlab = "Predictor x4", + ylab = "Response y", + point_col = rgb(0,0,1,0.2), + pred_point_col = "blue", + cat_labels = c("group A", "group B", "group C")) Note: CIs for gls models use the fixed-effect covariance matrix. > > sim.data$x5 <- sample(c(rep("CatA", 50), rep("CatB", 50))) > mod.gls2 <- gls(y ~ x1 + x2 + x4 * x5, + correlation = corAR1(form = ~1|group), + data = sim.data) > old_xpd_mar <- par(xpd = TRUE, mar = c(5.1, 4.1, 4.1, 5.1)) > easyViz(model = mod.gls2, data = sim.data, predictor = "x4", + by = "x5", + jitter_data_points = TRUE, + bty = "n", + ylim = c(-15,15), + xlab = "Predictor x4", + ylab = "Response y", + cat_labels = c("group A", "group B", "group C"), + point_col = c(rgb(0,0,1,0.2), rgb(1,0,0,0.2)), + pred_point_col = c("blue", "red"), + ci_bar_col = c("blue", "blue", "blue", "red", "red", "red"), + ci_bar_caps = 0, + legend_position = "topright", + legend_args = list(title = "Predictor x5", + title.cex = 1, + legend = c("A", "B"), + pt.cex = 1.25, + horiz = TRUE, + inset = c(-0.2, 0))) Note: CIs for gls models use the fixed-effect covariance matrix. > par(old_xpd_mar) > > #------------------------------------------ > # 4. Nonlinear least squares (nls) > #------------------------------------------ > mod.nls <- nls(y ~ a * sin(b * x3) + c, + data = sim.data, + start = list(a = 5, b = 1, c = 0)) > summary(mod.nls) Formula: y ~ a * sin(b * x3) + c Parameters: Estimate Std. Error t value Pr(>|t|) a 5.31584 0.54493 9.755 4.53e-16 *** b 1.08158 0.04723 22.898 < 2e-16 *** c 0.51338 0.44399 1.156 0.25 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 3.979 on 97 degrees of freedom Number of iterations to convergence: 3 Achieved convergence tolerance: 3.031e-06 > easyViz(model = mod.nls, data = sim.data, predictor = "x3", + pred_on_top = TRUE, + font_family = "serif", + bty = "n", + xlab = "Predictor x3", + ylab = "Response y", + point_col = rgb(0,1,0,0.7), + point_pch = 1, + ci_type = "lines", + ci_line_col = "black", + ci_line_lty = 2) Note: CIs for nls models use a delta-method approximation. > text(x = 2.5, y = 11, + labels = expression(Y %~% 5.31584 %*% sin(1.08158 %*% X[3]) + 0.51338), + cex = 0.7) > > #------------------------------------------ > # 5. Generalized linear model (glm) > #------------------------------------------ > mod.glm <- glm(binary_y ~ x1 + x4 + offset(log(offset_var)), + family = binomial(link="cloglog"), + data = sim.data) > easyViz(model = mod.glm, data = sim.data, predictor = "x1", + fix_values = list(x4="b", offset_var=1), + xlab = "Predictor x1", + ylab = "Response y", + binary_data_type = "binned", + point_col = "black", + ci_polygon_col = "red", + ci_polygon_alpha = 1) > > easyViz(model = mod.glm, data = sim.data, predictor = "x4", + bty = "n", + xlab = "Predictor x4", + ylab = "Response y", + binary_data_type = "plain", + jitter_data_points = TRUE, + point_col = "black", + point_pch = "|", + point_cex = 0.5) > > mod.glm2 <- glm(y1/y3 ~ x1 + x4, weights = y3, + family = binomial(link="logit"), + data = sim.data) > easyViz(model = mod.glm2, data = sim.data, predictor = "x1", + pred_on_top = TRUE, + xlab = "Predictor x1", + ylab = "Response y", + point_col = "black", + ci_polygon_col = "red") Detected successes / trials response. Plotting success proportions. > > #------------------------------------------ > # 6. Negative binomial GLM (glm.nb) > #------------------------------------------ > mod.glm.nb <- glm.nb(count_y ~ x2 + offset(log(offset_var)), + data = sim.data) > easyViz(model = mod.glm.nb, data = sim.data, predictor = "x2", + font_family = "mono", + bty = "L", + plot_args = list(main = "NB model"), + xlab = "Predictor x2", + ylab = "Response y", + ci_polygon_col = "blue") Offset detected: plotting (count_y / offset_var) * 1 (rate scaled to exposure = 1). Looks like you are modeling a rate. Setting exposure 'offset_var' to 1 so predictions are on the unit-rate scale. To obtain predictions on a different rate scale, specify the argument fix_values = c(offset_var = ...). > > #------------------------------------------ > # 7. Beta regression (betareg) > #------------------------------------------ > sim.data$prop <- y1/y3 > mod.betareg <- betareg(prop ~ x1 * x4, offset = log(offset_var), + data = sim.data, link= "cloglog") Error in loadNamespace(x) : there is no package called 'statmod' Calls: betareg ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart Execution halted * checking PDF version of manual ... [21s] OK * checking HTML version of manual ... OK * DONE Status: 1 ERROR, 1 NOTE