Description Usage Arguments Value Examples
This is a helper function that sums question weights from surveys to compute a total score. The data comes from the following ETO Results report: "[Admin] raw_touchpoint_report_detailed".
1 2 3 | sum_weights(tp_data, var = c("subject_id", "date", "answer_id", "question_id",
"question_short", "answer_weight"), weight_var = "answer_weight",
weight_id = "^q", group_var = c("subject_id", "answer_id"))
|
tp_data |
dataframe: a dataframe containing touchpoint data."[Admin] raw_touchpoint_report_detailed" |
var |
character vector: column names to keep for calculations |
weight_id |
character: pattern that identifies the question to be included in the sum of weights. Can be a regular expression. |
dataframe
1 2 3 4 5 | tp <- laycUtils::load_txt('./my_data_folder/touchpoints.txt')
tp <- laycUtils::format_data(tp)
tp <- tp[tp$tp_name == "jrt pre-/post test", ]
sum_weights(tp_data = tp)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.