Separate one word per column
Arguments
- data
A tidy data frame containing a column called "ngram"
- names_prefix
The prefixed name of the new columns, as in "word_1", "word_2", etc.
- ...
Additional options passed to
tidyr::separate_wider_delim()
See also
Other n-gram helpers:
add_ngrams(),
combine_ngrams(),
plot_bigrams()
Examples
if (FALSE) { # \dontrun{
my_corpus <- load_texts(n = 2)
my_bigrams <- my_corpus |>
separate_ngrams()
dubliners <- get_gutenberg_corpus(2814) |>
load_texts() |>
identify_by(part) |>
standardize_titles()
dubliners |>
add_ngrams() |>
combine_ngrams() |>
separate_ngrams() |>
head()
} # }
