Count the amount of a particlar response that respondents have across a group of vars.
1 2 | count_vars(df, vars, response = 1, idname = "id", colname = "value",
vectorize = FALSE)
|
df |
dataframe. The data to be transformed. |
vars |
character. A vector of variables to check. |
response |
character. The value of the response that you want to count. Defaults to 1. |
idname |
character. The name of the variable in the dataframe where respondent ids are kept. Defaults to 'id'. |
colname |
character. The output will be a two-column dataframe with ids and values. The names are the idname for ids and this (default 'value') for the values. |
vectorize |
logical. If false, the output will be a dataframe. If true, the output will instead be just a vector of the values. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.