From 2fd98103cb6b6c9adc8dc85244b561836ae5e6b1 Mon Sep 17 00:00:00 2001 From: Indrajeet Patil Date: Thu, 5 Oct 2023 19:39:13 +0200 Subject: [PATCH] avoid loaded term --- R/1_model_parameters.R | 4 ++-- R/ci_generic.R | 2 +- R/cluster_analysis.R | 4 ++-- R/cluster_meta.R | 2 +- R/equivalence_test.R | 2 +- R/format_parameters.R | 2 +- R/methods_BayesFactor.R | 2 +- R/methods_betareg.R | 8 ++++---- R/methods_brglm2.R | 8 ++++---- R/methods_cgam.R | 2 +- R/methods_glmmTMB.R | 4 ++-- R/methods_hglm.R | 2 +- R/methods_mice.R | 2 +- R/pool_parameters.R | 2 +- R/standardize_info.R | 4 ++-- R/standardize_parameters.R | 2 +- R/standardize_posteriors.R | 2 +- R/utils_format.R | 4 ++-- WIP/extract_random_variances.R | 2 +- 19 files changed, 30 insertions(+), 30 deletions(-) diff --git a/R/1_model_parameters.R b/R/1_model_parameters.R index 160de9f1c..0113673b7 100644 --- a/R/1_model_parameters.R +++ b/R/1_model_parameters.R @@ -475,10 +475,10 @@ model_parameters.default <- function(model, vcov = NULL, vcov_args = NULL, ...) { - # sanity check for inputs + # validation check for inputs .is_model_valid(model) - # sanity check, warn if unsupported argument is used. + # validation check, warn if unsupported argument is used. # unsupported arguments will be removed from the argument list. dots <- .check_dots( dots = list(...), diff --git a/R/ci_generic.R b/R/ci_generic.R index 5e65f0ae7..60776f5be 100644 --- a/R/ci_generic.R +++ b/R/ci_generic.R @@ -91,7 +91,7 @@ # for polr, we need to fix parameter names params$Parameter <- gsub("Intercept: ", "", params$Parameter, fixed = TRUE) - # sanity check... + # validation check... if (is.null(method)) { method <- "wald" } diff --git a/R/cluster_analysis.R b/R/cluster_analysis.R index 62829e38a..4d10ec0f6 100644 --- a/R/cluster_analysis.R +++ b/R/cluster_analysis.R @@ -148,12 +148,12 @@ cluster_analysis <- function(x, x <- as.data.frame(x) } - # sanity check - needs data frame + # validation check - needs data frame if (!is.data.frame(x)) { insight::format_error("`x` needs to be a data frame.") } - # sanity check - need at least two columns + # validation check - need at least two columns if (ncol(x) < 2) { insight::format_error("At least two variables required to compute a cluster analysis.") } diff --git a/R/cluster_meta.R b/R/cluster_meta.R index dc9312fca..dfe737ec9 100644 --- a/R/cluster_meta.R +++ b/R/cluster_meta.R @@ -77,7 +77,7 @@ cluster_meta <- function(list_of_clusters, rownames = NULL, ...) { x[[name]] <- solution } - # Sanity check + # validation check if (length(unique(lengths(x))) != 1) { insight::format_error("The clustering solutions are not of equal lengths.") } diff --git a/R/equivalence_test.R b/R/equivalence_test.R index 3ddeb0c50..b72475009 100644 --- a/R/equivalence_test.R +++ b/R/equivalence_test.R @@ -315,7 +315,7 @@ equivalence_test.ggeffects <- function(x, x <- .get_ggeffects_model(x) - # sanity check rope range + # validation check rope range rule <- match.arg(tolower(rule), choices = c("bayes", "classic", "cet")) range <- .check_rope_range(x, range, verbose) diff --git a/R/format_parameters.R b/R/format_parameters.R index 99538aae4..101c6227a 100644 --- a/R/format_parameters.R +++ b/R/format_parameters.R @@ -367,7 +367,7 @@ format_parameters.parameters_model <- function(model, ...) { model <- .get_object(params) } - # sanity check + # validation check if (!is.null(model) && insight::is_regression_model(model) && !is.data.frame(model)) { # get data, but exclude response - we have no need for that label mf <- insight::get_data(model, source = "mf", verbose = FALSE) diff --git a/R/methods_BayesFactor.R b/R/methods_BayesFactor.R index cc39d1558..99573ef62 100644 --- a/R/methods_BayesFactor.R +++ b/R/methods_BayesFactor.R @@ -196,7 +196,7 @@ model_parameters.BFBayesFactor <- function(model, out <- datawizard::remove_empty(out) - # sanity check: make sure BF column still exists, + # validation check: make sure BF column still exists, # see https://github.com/easystats/correlation/issues/269 if (is.null(out$BF)) { out$BF <- NA diff --git a/R/methods_betareg.R b/R/methods_betareg.R index b1cf522f6..dbc8451ac 100644 --- a/R/methods_betareg.R +++ b/R/methods_betareg.R @@ -15,7 +15,7 @@ model_parameters.betareg <- function(model, drop = NULL, verbose = TRUE, ...) { - # sanity check, warn if unsupported argument is used. + # validation check, warn if unsupported argument is used. dot_args <- .check_dots( dots = list(...), not_allowed = c("vcov", "vcov_args"), @@ -62,7 +62,7 @@ ci.betareg <- function(x, component = "all", verbose = TRUE, ...) { - # sanity check, warn if unsupported argument is used. + # validation check, warn if unsupported argument is used. dot_args <- .check_dots( dots = list(...), not_allowed = c("vcov", "vcov_args"), @@ -81,7 +81,7 @@ standard_error.betareg <- function(model, component = "all", verbose = TRUE, ...) { - # sanity check, warn if unsupported argument is used. + # validation check, warn if unsupported argument is used. dot_args <- .check_dots( dots = list(...), not_allowed = c("vcov", "vcov_args"), @@ -116,7 +116,7 @@ p_value.betareg <- function(model, component = c("all", "conditional", "precision"), verbose = TRUE, ...) { - # sanity check, warn if unsupported argument is used. + # validation check, warn if unsupported argument is used. dot_args <- .check_dots( dots = list(...), not_allowed = c("vcov", "vcov_args"), diff --git a/R/methods_brglm2.R b/R/methods_brglm2.R index b39da67a6..2b6c0cdf2 100644 --- a/R/methods_brglm2.R +++ b/R/methods_brglm2.R @@ -19,7 +19,7 @@ model_parameters.bracl <- function(model, drop = NULL, verbose = TRUE, ...) { - # sanity check, warn if unsupported argument is used. + # validation check, warn if unsupported argument is used. dot_args <- .check_dots( dots = list(...), not_allowed = c("vcov", "vcov_args"), @@ -70,7 +70,7 @@ model_parameters.bracl <- function(model, #' @export ci.bracl <- function(x, ci = 0.95, method = NULL, verbose = TRUE, ...) { - # sanity check, warn if unsupported argument is used. + # validation check, warn if unsupported argument is used. dot_args <- .check_dots( dots = list(...), not_allowed = c("vcov", "vcov_args"), @@ -90,7 +90,7 @@ ci.bracl <- function(x, ci = 0.95, method = NULL, verbose = TRUE, ...) { #' @export standard_error.bracl <- function(model, verbose = TRUE, ...) { - # sanity check, warn if unsupported argument is used. + # validation check, warn if unsupported argument is used. dot_args <- .check_dots( dots = list(...), not_allowed = c("vcov", "vcov_args"), @@ -115,7 +115,7 @@ standard_error.bracl <- function(model, verbose = TRUE, ...) { #' @export p_value.bracl <- function(model, verbose = TRUE, ...) { - # sanity check, warn if unsupported argument is used. + # validation check, warn if unsupported argument is used. dot_args <- .check_dots( dots = list(...), not_allowed = c("vcov", "vcov_args"), diff --git a/R/methods_cgam.R b/R/methods_cgam.R index 343cbd604..661dbf2e4 100644 --- a/R/methods_cgam.R +++ b/R/methods_cgam.R @@ -43,7 +43,7 @@ model_parameters.cgam <- function(model, drop = NULL, verbose = TRUE, ...) { - # sanity check, warn if unsupported argument is used. + # validation check, warn if unsupported argument is used. dot_args <- .check_dots( dots = list(...), not_allowed = c("vcov", "vcov_args", "component"), diff --git a/R/methods_glmmTMB.R b/R/methods_glmmTMB.R index 67831ca8c..9738c947b 100644 --- a/R/methods_glmmTMB.R +++ b/R/methods_glmmTMB.R @@ -28,7 +28,7 @@ model_parameters.glmmTMB <- function(model, ...) { insight::check_if_installed("glmmTMB") - # sanity check, warn if unsupported argument is used. + # validation check, warn if unsupported argument is used. dot_args <- .check_dots( dots = list(...), not_allowed = c("vcov", "vcov_args"), @@ -268,7 +268,7 @@ ci.glmmTMB <- function(x, return(NULL) } - # sanity check, warn if unsupported argument is used. + # validation check, warn if unsupported argument is used. dot_args <- .check_dots( dots = list(...), not_allowed = c("vcov", "vcov_args"), diff --git a/R/methods_hglm.R b/R/methods_hglm.R index fb8ab32af..beb24306d 100644 --- a/R/methods_hglm.R +++ b/R/methods_hglm.R @@ -115,7 +115,7 @@ standard_error.hglm <- function(model, return(NULL) } - # sanity check, make sure we have a dispersion component + # validation check, make sure we have a dispersion component if (component == "all" && is.null(f$dispersion)) { compomnent <- "conditional" } diff --git a/R/methods_mice.R b/R/methods_mice.R index 8534ccffa..3f0511b9f 100644 --- a/R/methods_mice.R +++ b/R/methods_mice.R @@ -92,7 +92,7 @@ model_parameters.mipo <- function(model, drop = NULL, verbose = TRUE, ...) { - # sanity check, warn if unsupported argument is used. + # validation check, warn if unsupported argument is used. dot_args <- .check_dots( dots = list(...), not_allowed = c("vcov", "vcov_args"), diff --git a/R/pool_parameters.R b/R/pool_parameters.R index d6044784c..8e278ddf6 100644 --- a/R/pool_parameters.R +++ b/R/pool_parameters.R @@ -186,7 +186,7 @@ pool_parameters <- function(x, df_column <- grep("(\\bdf\\b|\\bdf_error\\b)", colnames(i), value = TRUE)[1] if (length(df_column)) { pooled_df <- .barnad_rubin(m = nrow(i), b = stats::var(i$Coefficient), t = tmp, dfcom = unique(i[[df_column]])) - # sanity check length + # validation check length if (length(pooled_df) > 1 && length(pooled_se) == 1) { pooled_df <- round(mean(pooled_df, na.rm = TRUE)) } diff --git a/R/standardize_info.R b/R/standardize_info.R index 3564d3404..9993c60b2 100644 --- a/R/standardize_info.R +++ b/R/standardize_info.R @@ -55,7 +55,7 @@ standardize_info.default <- function(model, data <- insight::get_data(model, source = "mf", verbose = FALSE) wgts <- insight::get_weights(model, na_rm = TRUE) - # Sanity Check for ZI + # validation check for ZI if (mi$is_zero_inflated && verbose) { insight::format_alert( "Non-refit parameter standardization is ignoring the zero-inflation component." @@ -63,7 +63,7 @@ standardize_info.default <- function(model, # would need to also get the binomial model matrix... } - # Sanity Check for glmmTMB with dispersion + # validation check for glmmTMB with dispersion if (length(params) != nrow(types)) { types <- types[types$Parameter %in% params, ] } diff --git a/R/standardize_parameters.R b/R/standardize_parameters.R index 94f0c8cf8..e7968b6d3 100644 --- a/R/standardize_parameters.R +++ b/R/standardize_parameters.R @@ -550,7 +550,7 @@ print_html.parameters_standardized <- function(x, digits = 2, ...) { exponentiate, include_response, verbose) { - # Sanity Check for "pseudo" + # validation check for "pseudo" method <- .should_pseudo(method, model, mi) method <- .cant_smart_or_posthoc(method, model, mi, pars$Parameter) diff --git a/R/standardize_posteriors.R b/R/standardize_posteriors.R index a6606c98c..cccab54ca 100644 --- a/R/standardize_posteriors.R +++ b/R/standardize_posteriors.R @@ -51,7 +51,7 @@ standardise_posteriors <- standardize_posteriors #' @keywords internal .standardize_posteriors_posthoc <- function(pars, method, model, mi, robust, two_sd, include_response, verbose) { - # Sanity Check for "pseudo" + # validation check for "pseudo" method <- .should_pseudo(method, model) method <- .cant_smart_or_posthoc(method, model, mi, pars$Parameter) diff --git a/R/utils_format.R b/R/utils_format.R index b32169bcd..dfb55a88e 100644 --- a/R/utils_format.R +++ b/R/utils_format.R @@ -666,7 +666,7 @@ i }) - # sanity check - check if all parameter names in the + # validation check - check if all parameter names in the # group list are spelled correctly misspelled <- vapply(group_rows, anyNA, TRUE) @@ -926,7 +926,7 @@ # make sure we have correct sorting here... tables <- split(x, f = split_by) - # sanity check - only preserve tables with any data in data frames + # validation check - only preserve tables with any data in data frames tables <- tables[vapply(tables, nrow, numeric(1)) > 0] diff --git a/WIP/extract_random_variances.R b/WIP/extract_random_variances.R index 82291c024..a77a9e85d 100644 --- a/WIP/extract_random_variances.R +++ b/WIP/extract_random_variances.R @@ -882,7 +882,7 @@ # anything missing? (i.e. correlated slope-intercept slopes) missig_rnd_slope <- setdiff(names(out), names(rndslopes)) if (length(missig_rnd_slope)) { - # sanity check + # validation check to_remove <- c() for (j in seq_along(out)) { # identical random slopes might have different names, so