| 1 |
## ----------------------------------------------------------------------------- |
| 2 |
knitr::opts_chunk$set( |
| 3 |
collapse = TRUE, |
| 4 |
comment = "#>" |
| 5 |
) |
| 6 |
|
| 7 |
## ----------------------------------------------------------------------------- |
| 8 |
library(broom) |
| 9 |
library(dplyr) |
| 10 |
library(stringr) |
| 11 |
|
| 12 |
method_df <- function(method_name) { |
| 13 |
m <- as.vector(methods(method_name)) |
| 14 |
tibble::tibble( |
| 15 |
class = str_remove(m, str_c(method_name, "[.]")), |
| 16 |
!!method_name := "x" |
| 17 |
) |
| 18 |
} |
| 19 |
|
| 20 |
method_df("tidy") |> |
| 21 |
left_join(method_df("glance")) |> |
| 22 |
left_join(method_df("augment")) |> |
| 23 |
mutate_all(tidyr::replace_na, "") |> |
| 24 |
knitr::kable() |
| 25 |
|