Description Usage Arguments Details Value Examples
View source: R/tidy_verbatim.R
This function creates a long table with one row per phrase and column. It allows the user to set the n-gram parameter (how many words per phrase) and then utilizes the tidytext library to unnest each verbatim response. Any NA responses are dropped.
1 | tidy_verbatim(data, id = id, cols = selected_cols, n = 1)
|
data |
Data frame with the survey data |
id |
Unique survey id. By default, can be omitted if column is named 'id' |
cols |
List of column(s) to be unnested. By default, can be omitted if using vector named 'selected_cols' |
n |
Length of phrases, in words. By default is 1 (unigrams) |
It's recommended that you select your columns into a vector outside of the function call, because you will probably want to re-use that list with other functions in the package.
A data frame with one row per phrase and column, with survey id.
1 2 3 | data(bloom_survey)
selected_cols <- c("q19verb", "q20verb")
surveys <- tidy_verbatim(bloom_survey, n = 3)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.