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

Make add_glance_*(galnce_fun) an S3 generic default #1822

Closed
ddsjoberg opened this issue Jul 10, 2024 · 0 comments · Fixed by #1941
Closed

Make add_glance_*(galnce_fun) an S3 generic default #1822

ddsjoberg opened this issue Jul 10, 2024 · 0 comments · Fixed by #1941
Milestone

Comments

@ddsjoberg
Copy link
Owner

Current the default value is galnce_fun = broom::glance, and we do a little trick inside that if the user didn't specify anything AND it's a mice model, we replace the default with

if (missing(glance_fun) && inherits(x$inputs$x, "mice")) {
    check_pkg_installed("mice", reference_pkg = "gtsummary")
    glance_fun <- \(x) broom::glance(mice::pool(x))
  }

As we plan to decouple many of the gtsummary dependencies, this default should be an S3 generic so it can easily be extended in a supplementary package and gtsummary won't have {mice} listed as a Suggested package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant