rescale_for_against_4: Rescale 4-level agreement (for-against) categories

Description Usage Arguments Examples

Description

Rescale Eurobarometer 4-level agreement (for-against) categories, "Strongly in favour" and "Fairly in favour" and "Fairly opposed", "Strongly opposed". This is a wrapper function around the rescale_categories function.

Usage

1
2
3
4
rescale_for_against_4(column, from = c("Strongly in favour",
  "Fairly in favour", "Fairly opposed", "Strongly opposed"), to = c(2, 1, -1,
  -2), na_labels = "default", underscore = TRUE, exact_from = TRUE,
  return_class = "numeric")

Arguments

column

A column from a survey data frame where the level of informnedss is recorded.

from

Defaults "Strongly in favour", "Fairly in favour" and "Fairly opposed", "Strongly opposed".

to

Defaults to c(2,1,-1,-2). If return_class = "character" or return_class = "factor" is selected it returns the abbreviated category names c("strongly_for", "for", "against", "strongly_against").

na_labels

Defaults to default. The pre-coded profiles can be accessed via get_na_labels.

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.

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
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
rescale_for_against_4 (column =
c("Strongly in favour",
  "Fairly in favour",
  "Fairly opposed",
  "Strongly opposed",
  "DK", "NT/NV"),
na_labels = "default",
return_class = "character")

rescale_for_against_4 (column =
                     c("Strongly in favour",
                     "Fairly in favour",
                     "Fairly opposed",
                     "Strongly opposed",
                     "DK", "NT/NV"),
                     na_labels = "default",
                     return_class = "numeric")

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