Description Usage Arguments Details Value Examples
View source: R/survey_detect_qtypes.R
Looks at the possible answers in a column, and determines which type of question is most likely. This is based on rules of thumb and can be tuned for different uses using the calculation criteria.
1 2 3 4 5 6 7 | survey_detect_qtypes(
response_col,
unique_vals = 20,
split_perc = 0.5,
prop_total = 0.55,
prop_common = 0.05
)
|
response_col |
column from response dataframe |
unique_vals |
integer |
split_perc |
float |
prop_total |
float |
prop_common |
float |
Calculation criteria can be set by the user:
unique_vals
: what's the maximum number of unique values a column can have, to always consider it categorical?
split_perc
: determines which questions are deemed multi-choice: if the answers are split by comma, how much fewer unique values should that column have than before splitting? Helps distinguish between free-text and multi-choice.
prop_total
: if the 5 most common values account for this proportion of the total number of answers, consider it categorical
prop_common
: if the most common response is at most this proportion of the total, consider it free text
a string value
1 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.