tidy
will return a data frame that contains information
regarding a recipe or operation within the recipe (when a tidy
method for the operation exists).
# S3 method for recipe tidy(x, number = NA, id = NA, ...) # S3 method for step tidy(x, ...) # S3 method for check tidy(x, ...)
x | A |
---|---|
number | An integer or |
id | A character string or |
... | Not currently used. |
A tibble with columns that would vary depending on what
tidy
method is executed. When number
and id
are NA
, a
tibble with columns number
(the operation iteration),
operation
(either "step" or "check"),
type
(the method, e.g. "nzv", "center"), a logical
column called trained
for whether the operation has been
estimated using prep
, a logical for skip
, and a character column id
.
library(modeldata) data(okc) okc_rec <- recipe(~ ., data = okc) %>% step_other(all_nominal(), threshold = 0.05, other = "another") %>% step_date(date, features = "dow") %>% step_center(all_numeric()) %>% step_dummy(all_nominal()) %>% check_cols(starts_with("date"), age, height) tidy(okc_rec)#> # A tibble: 5 x 6 #> number operation type trained skip id #> <int> <chr> <chr> <lgl> <lgl> <chr> #> 1 1 step other FALSE FALSE other_OruwB #> 2 2 step date FALSE FALSE date_l3nYA #> 3 3 step center FALSE FALSE center_jp5Kj #> 4 4 step dummy FALSE FALSE dummy_FhDIk #> 5 5 check cols FALSE FALSE cols_IyjzO#> # A tibble: 1 x 4 #> terms value ordinal id #> <chr> <chr> <lgl> <chr> #> 1 date dow FALSE date_l3nYA#> # A tibble: 1 x 3 #> terms value id #> <chr> <dbl> <chr> #> 1 all_numeric() NA center_jp5Kj#> Warning: There are new levels in a factor: NA#> # A tibble: 5 x 6 #> number operation type trained skip id #> <int> <chr> <chr> <lgl> <lgl> <chr> #> 1 1 step other TRUE FALSE other_OruwB #> 2 2 step date TRUE FALSE date_l3nYA #> 3 3 step center TRUE FALSE center_jp5Kj #> 4 4 step dummy TRUE FALSE dummy_FhDIk #> 5 5 check cols TRUE FALSE cols_IyjzO#> # A tibble: 2 x 3 #> terms value id #> <chr> <dbl> <chr> #> 1 age 32.3 center_jp5Kj #> 2 height 68.3 center_jp5Kj