Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cli refresh #70

Merged
merged 2 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Depends:
parsnip (>= 1.0.0),
R (>= 3.5)
Imports:
cli,
dplyr,
lme4,
purrr,
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
13 changes: 7 additions & 6 deletions R/gee.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(<fake-lm-object>)"
class(res) <- c(class(res), "lm")
Expand Down
2 changes: 1 addition & 1 deletion R/multilevelmod-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading