rescale_difficulty: Rescale difficulty

Description Usage Arguments Examples

Description

Create a uniform variable from three categories of the Eurobarometer subjective living condition trend variable with categories such as "Most of the time", "From time to time" and "Almost never/never". This is a wrapper function around the rescale_categories function.

Usage

1
2
3
rescale_difficulty(column, from = c("Most of the time", "From time to time",
  "Almost never/never"), to = c(2, 1, 0), na_labels = c("NA", "DK"),
  exact_from = TRUE, return_class = "numeric")

Arguments

column

A column from a survey data frame where gender is recorded.

from

Defaults to c("Most of the time", "From time to time", "Almost never/never".

to

Defaults to c(2,1,0).

na_labels

Defaults to c("NA","DK").

exact_from

Deafults to TRUE. If FALSE you can use the partial matching, but beware that in this case, "twenty" will be replaced by

return_class

Default is "numeric", alternatives "character" or "factor".

Examples

1
2
3
4
rescale_difficulty (column =
                      c("Most of the time", "From time to time",
                        "Almost never/never", "MOST of the TIME", "Refusal (SPONT.)", NA),
                    na_labels = "Refusal (SPONT.)")

antaldaniel/surveyreader documentation built on May 16, 2019, 2:29 a.m.