diff --git a/DESCRIPTION b/DESCRIPTION index 56455e72a..0f8cf494c 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -18,7 +18,7 @@ Depends: R (>= 2.10) Imports: dplyr, - rlang (>= 0.3.0.1), + rlang (>= 0.3.1), purrr, utils, tibble, @@ -29,7 +29,7 @@ Imports: tidyr, globals Roxygen: list(markdown = TRUE) -RoxygenNote: 6.1.0.9000 +RoxygenNote: 6.1.1 Suggests: testthat, knitr, @@ -39,4 +39,3 @@ Suggests: xgboost, covr, sparklyr - diff --git a/NAMESPACE b/NAMESPACE index 8ce771ce7..57d7b8425 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -119,6 +119,7 @@ export(show_call) export(surv_reg) export(svm_poly) export(svm_rbf) +export(tidy.model_fit) export(translate) export(varying) export(varying_args) diff --git a/R/tidy.R b/R/tidy.R new file mode 100644 index 000000000..ce5d4df91 --- /dev/null +++ b/R/tidy.R @@ -0,0 +1,9 @@ +#' Turn a parsnip model object into a tidy tibble +#' +#' This method tidies the model in a parsnip model object, if it exists. +#' +#' @inheritParams generics::tidy +#' +#' @return a tibble +#' @export +tidy.model_fit <- function(x, ...) generics::tidy(x$fit, ...) diff --git a/man/tidy.model_fit.Rd b/man/tidy.model_fit.Rd new file mode 100644 index 000000000..a2c8564b2 --- /dev/null +++ b/man/tidy.model_fit.Rd @@ -0,0 +1,19 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/tidy.R +\name{tidy.model_fit} +\alias{tidy.model_fit} +\title{Turn a parsnip model object into a tidy tibble} +\usage{ +tidy.model_fit(x, ...) +} +\arguments{ +\item{x}{An object to be converted into a tidy \code{\link[tibble:tibble]{tibble::tibble()}}.} + +\item{...}{Additional arguments to tidying method.} +} +\value{ +a tibble +} +\description{ +This method tidies the model in a parsnip model object, if it exists. +}