diff --git a/DESCRIPTION b/DESCRIPTION index c84078c..95b9c6d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -20,6 +20,7 @@ Depends: parsnip (>= 1.0.0), R (>= 3.5) Imports: + cli, dplyr, lme4, purrr, diff --git a/NAMESPACE b/NAMESPACE index e9fb3ae..63c25e5 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -2,6 +2,7 @@ export(gee_fit) import(rlang) +importFrom(cli,cli_abort) importFrom(parsnip,check_final_param) importFrom(parsnip,decision_tree) importFrom(parsnip,fit) diff --git a/R/gee.R b/R/gee.R index cda41bf..95cdbb0 100755 --- a/R/gee.R +++ b/R/gee.R @@ -23,11 +23,12 @@ gee_formula <- function(f) { id_ind <- attr(trms,"specials")$id_var + 1 # check length if (length(id_ind) != 1) { - rlang::abort( - paste( - "There should be a single 'id' column specified using the `id_vars()`", - "function (e.g. `y ~ x + id_vars(id_col)`" - ) + cli::cli_abort( + c( + "There should be a single {.field id} column specified using the + {.fn id_vars} function.", + "i" = "For example: {.code y ~ x + id_vars(id_col)}" + ) ) } # find column with id variable @@ -105,7 +106,7 @@ gee_fit <- function(formula, data, family = gaussian, ...) { res$rank <- tmp_glm$rank res$qr <- tmp_glm$qr } else { - rlang::abort("Cannot compute the rank of the design matrix.") + cli::cli_abort("Cannot compute the rank of the design matrix.") } # Now to avoid a warning about "calling predict.lm()" class(res) <- c(class(res), "lm") diff --git a/R/multilevelmod-package.R b/R/multilevelmod-package.R index 331d8ed..353aa5f 100644 --- a/R/multilevelmod-package.R +++ b/R/multilevelmod-package.R @@ -18,7 +18,7 @@ ## usethis namespace: start #' @import rlang -#' +#' @importFrom cli cli_abort #' @importFrom parsnip set_engine fit fit_xy fit_control mars decision_tree #' @importFrom parsnip set_new_model multi_predict update_dot_check show_fit #' @importFrom parsnip new_model_spec null_value update_main_parameters