show_tokens: Show token output of recipe

Description Usage Arguments Value Examples

View source: R/show_tokens.R

Description

Returns the tokens as a list of character vector of a recipe. This function can be useful for diagnostics doing recipe construction but should not be used in final recipe steps. Note that this function will both prep() and bake() the recipe it is used on.

Usage

1

Arguments

rec

A recipe object

var

name of variable

Value

A list of character vectors

Examples

1
2
3
4
5
text_tibble <- tibble(text = c("This is words", "They are nice!"))

recipe(~ text, data = text_tibble) %>%
  step_tokenize(text) %>%
  show_tokens(text)

textrecipes documentation built on July 11, 2021, 9:06 a.m.