Skip to content
Open
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
2 changes: 2 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ on:
branches:
- main
- master
- dev
pull_request:
branches:
- main
- master
- dev

name: R-CMD-check

Expand Down
4 changes: 3 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Authors@R:
role = c("aut", "cre"),
email = "packages@jaredlander.com",
comment = c(ORCID = "0000-0002-7291-726X"))
Version: 1.2.9
Version: 1.3.1
Date: 2025-08-23
Description: Plots the coefficients from model objects. This very quickly shows the user the point estimates and confidence intervals for fitted models.
License: BSD_3_clause + file LICENSE
Expand Down Expand Up @@ -39,3 +39,5 @@ Suggests:
rmarkdown
Encoding: UTF-8
RoxygenNote: 7.3.2
Enhances:
hardhat
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Version 1.3.1
- Added support for tidymodels workflows

# Version 1.2.9
- Bug Fixes

# Version 1.2.8
- Methods for plotting `{workflows}` and `{parsnip}` models.
- Fixed warning due to deprecation of `guide` argument in `{ggplot2}`.
Expand Down
14 changes: 14 additions & 0 deletions R/coefplot.r
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,20 @@ coefplot.model_fit <- function(model, ...)
coefplot.default(model$fit, ...)
}

#' @title coefplot.workflow
#' @description Coefplot method for workflow objects
#' @details Pulls model element out of workflow object then calls \code{coefplot}.
#' @export
# @author Jared P. Lander
#' @describeIn coefplot \code{workflow}
#' @param model A workflow object
#' @param \dots All arguments are passed on to \code{\link{coefplot}}. Please see that function for argument information.
#'
coefplot.model_fit <- function(model, ...)
{
coefplot(hardhat::extract_fit_engine(model), ...)
}

#' coefplot.rxGlm
#'
# Dotplot for rxGlm coefficients
Expand Down
4 changes: 2 additions & 2 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Version Number

1.2.9
1.3.1

## Test environments

Expand All @@ -13,7 +13,7 @@
- ubuntu-22.04 (devel)
- ubuntu-24.04 (release)
- ubuntu-24.04 (devel)
- Ubuntu 12.04, R 4.5.1
- Ubuntu 22.04, R 4.5.1

## R CMD check results

Expand Down
10 changes: 9 additions & 1 deletion man/coefplot.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions tests/testthat/test-tidymodels.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ flow <- workflow() %>%
mod5 <- parsnip::fit(flow, data=mtcars)
mod6 <- parsnip::fit(lm_spec, mpg ~ cyl + qsec + disp, data=mtcars)

mod7 <- workflows::fit(flow, data=mtcars)

coef5_static_default <- coefplot(mod5)
coef5_static_false <- coefplot(mod5, interactive=FALSE)
coef5_interactive <- coefplot(mod5, interactive=TRUE)
Expand All @@ -18,12 +20,20 @@ coef6_static_false <- coefplot(mod6, interactive=FALSE)
coef6_interactive <- coefplot(mod6, interactive=TRUE)
coef6_interactive_sorted <- coefplot(mod6, interactive=TRUE, sort='magnitude')

coef7_static_default <- coefplot(mod7)
coef7_static_false <- coefplot(mod7, interactive=FALSE)
coef7_interactive <- coefplot(mod7, interactive=TRUE)
coef7_interactive_sorted <- coefplot(mod7, interactive=TRUE, sort='magnitude')

test_that("Static plots return ggplot objects", {
expect_s3_class(coef5_static_default, 'ggplot')
expect_s3_class(coef5_static_false, 'ggplot')

expect_s3_class(coef6_static_default, 'ggplot')
expect_s3_class(coef6_static_false, 'ggplot')

expect_s3_class(coef7_static_default, 'ggplot')
expect_s3_class(coef7_static_false, 'ggplot')
})

test_that("Interactive plots return plotly objects", {
Expand All @@ -32,4 +42,7 @@ test_that("Interactive plots return plotly objects", {

expect_s3_class(coef6_interactive, 'plotly')
expect_s3_class(coef6_interactive_sorted, 'plotly')

expect_s3_class(coef7_interactive, 'plotly')
expect_s3_class(coef7_interactive_sorted, 'plotly')
})
Loading