Skip to content

Commit e22fb5f

Browse files
committed
tidy nullmodel method
1 parent b58e42f commit e22fb5f

File tree

3 files changed

+45
-0
lines changed

3 files changed

+45
-0
lines changed

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ export(surv_reg)
160160
export(svm_poly)
161161
export(svm_rbf)
162162
export(tidy.model_fit)
163+
export(tidy.nullmodel)
163164
export(translate)
164165
export(translate.default)
165166
export(update_dot_check)

R/nullmodel.R

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,3 +182,23 @@ null_model <-
182182
class(out) <- make_classes("null_model")
183183
out
184184
}
185+
186+
187+
188+
#' Tidy method for null models
189+
#'
190+
#' Return the results of `nullmodel` as a tibble
191+
#'
192+
#' @param x A `nullmodel` object.
193+
#' @param ... Not used.
194+
#' @return A tibble with column `value`.
195+
#' @export
196+
#' @examples
197+
#' nullmodel(iris[,-5], iris$Species) %>% tidy()
198+
#'
199+
#' nullmodel(mtcars[,-1], mtcars$mpg) %>% tidy()
200+
201+
tidy.nullmodel <- function(x, ...) {
202+
tibble::tibble(value = x$value)
203+
}
204+

man/tidy.nullmodel.Rd

Lines changed: 24 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)