Skip to content

Commit 52ddb78

Browse files
authored
Merge pull request #121 from malcolmbarrett/tidy_model_object
add tidy() method for model_fit objects
2 parents c6a687e + 3dd5747 commit 52ddb78

File tree

4 files changed

+30
-1
lines changed

4 files changed

+30
-1
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Depends:
1818
R (>= 2.10)
1919
Imports:
2020
dplyr,
21-
rlang (>= 0.3.0.1),
21+
rlang (>= 0.3.1),
2222
purrr,
2323
utils,
2424
tibble,

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ export(show_call)
106106
export(surv_reg)
107107
export(svm_poly)
108108
export(svm_rbf)
109+
export(tidy.model_fit)
109110
export(translate)
110111
export(varying)
111112
export(varying_args)

R/tidy.R

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#' Turn a parsnip model object into a tidy tibble
2+
#'
3+
#' This method tidies the model in a parsnip model object, if it exists.
4+
#'
5+
#' @inheritParams generics::tidy
6+
#'
7+
#' @return a tibble
8+
#' @export
9+
tidy.model_fit <- function(x, ...) generics::tidy(x$fit, ...)

man/tidy.model_fit.Rd

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)