Description Usage Arguments Examples
View source: R/connect_to_formr.R
If you've retrieved an item table using formr_items()
you can use this
function to aggregate your multiple choice items into mean scores.
If you do not have a item table (e.g. your data was not collected using formr, you don't want another HTTP request in a time-sensitive process).
Example: If your data contains Extraversion_1, Extraversion_2R and Extraversion_3, there will be two new variables in the result: Extraversion_2 (reversed to align with _1 and _2) and Extraversion, the mean score of the three.
1 2 3 4 | formr_aggregate(survey_name, item_list = formr_items(survey_name, host =
host), results = formr_raw_results(survey_name, host = host),
host = "https://formr.org", compute_alphas = FALSE, fallback_max = 5,
plot_likert = FALSE, ...)
|
survey_name |
case-sensitive name of a survey your account owns |
item_list |
an item_list, will be auto-retrieved based on survey_name if omitted |
results |
survey results, will be auto-retrieved based on survey_name if omitted |
host |
defaults to https://formr.org |
compute_alphas |
defaults to TRUE, whether to compute |
fallback_max |
defaults to 5 - if the item_list is set to null, we will use this to reverse |
plot_likert |
defaults to TRUE - whether to make |
... |
passed to |
1 2 3 4 5 6 7 | results = jsonlite::fromJSON(txt =
system.file('extdata/gods_example_results.json', package = 'formr', mustWork = TRUE))
items = formr_items(path =
system.file('extdata/gods_example_items.json', package = 'formr', mustWork = TRUE))
agg = formr_aggregate(item_list = items, results = results,
compute_alphas = TRUE, plot_likert = TRUE)
agg[, c('religiousness', 'prefer')]
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.