Description Usage Arguments Examples
A generic function to rescale categorical variables.
There are wrapper functions available for the Eurobarometer trend
and demography questions with the default GESIS codes:
For example:
rescale_marital_status
for marital status.
rescale_occupation
for occupation and last job.
rescale_social_class_en
for class self-placement.
The get_answer_options
functions lists all the
currently recognized standard values.
1 2 | rescale_categories(column, from = c("Agree", "Disagree"), to = c(1, 0),
na_labels = NULL, exact_from = TRUE, return_class = "numeric")
|
column |
A column from a survey data frame with categorical variables. |
from |
Defaults to |
to |
Defaults to |
na_labels |
Defaults to |
exact_from |
Deafults to |
return_class |
Default is |
1 2 3 4 5 6 7 8 9 10 11 12 | rescale_categories (column =
c("Agree", "AGREE", "disagree",
"DK", "Refusal (SPONT.)", "Disagree"),
na_labels = c("DK", "Refusal (SPONT.)")
)
rescale_categories (column =
c("Agree", "AGREE", "disagree",
"DK", "Refusal (SPONT.)", "Disagree"),
na_labels = "default")
rescale_categories (column = c("Agree", "AGREE", "disagree"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.