rescale_outlook: Rescale outlook Eurobarometer questions

Description Usage Arguments Examples

Description

Rescale the standard Eurobarometer outlook variable(s) with categories "Better", "The same", "Worse". The generic question is "What are your expectations for the next twelve months: will the next twelve months be better, worse or the same, when it comes to...?" This is a wrapper function around the rescale_categories function.

Usage

1
2
3
rescale_outlook(column, from = c("Better", "Same", "Worse"), to = c(1, 0,
  -1), na_labels = "default", exact_from = TRUE, return_class = "numeric",
  underscore = TRUE)

Arguments

column

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

from

Defaults to "Better", "The same", "Worse".

to

Defaults to c(1,0,-1). If return_class = "character" or return_class = "factor" is selected it returns the abbreviated category names c("better", "same", "worse".

na_labels

Defaults to c("default").

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".

underscore

Defaults to TRUE in which case factor names or character strings contain underscore_between_words. This is a better approach for further programming, but you can choose FALSE for nicer printing results. See examples.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
rescale_outlook (column =
                        c("DK",
                          "Better",
                          "Worse",
                          "worse",
                          "The same"),
                      underscore = FALSE,
                      return_class = "character")

 rescale_outlook (column =
                        c("DK",
                          "Better",
                          "Worse",
                          "worse",
                          "The same"),
                      return_class = "numeric")

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