spread_ms: Cast multi-select responses into wide format

Description Usage Arguments Value

Description

Cast multi-select responses into wide format

Usage

1
spread_ms(resp, opt, resp_sep = NULL, opt_sep = NULL, prefix = "")

Arguments

resp

A list of character vectors, where each character vector is a response to a multi-select question. Each response can be a vector of strings, where each value represents a selected option, or a single string of all selected options that still needs to be split (must also use sep param).

opt

A character vector listing all possible response options to the multi-select question.

resp_sep

A single string containing a regular expression. Each string in resp will be split where this expression matches. A value of NULL indicates the responses are already split.

opt_sep

A single string containing a regular expression. Each string in opt will be split where this expression matches. A value of NULL indicates the options are already split.

prefix

A single string to prefix each column name in the output.

Value

A tibble with one column for each possible option and one row for each response. Logical values indicate whether each option was selected in each response.


TheFridayInstitute/fimoodler documentation built on May 28, 2019, 9:37 a.m.