rescale_direction: Rescale direction trend question

Description Usage Arguments Examples

Description

Create a uniform variable from the three categories such as "Things are going in the right direction", "Things are going in the wrong direction", "Neither one nor the other (SPONTANEOUS)" or " In the right direction", "In the wrong direction", "Neither one nor the other (SPONTANEOUS)". This is a wrapper function around the rescale_categories function.

Usage

1
2
3
rescale_direction(column, from = c("right direction", "wrong direction",
  "neither"), to = c(1, -1, 0), na_labels = "default", exact_from = TRUE,
  return_class = "numeric")

Arguments

column

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

from

Defaults to c("right direction", "wrong direction", "neither one nor the other") and looks for partial match in the text. Most other rescale_categories functions are looking for exact but non-case sensitive matches.

to

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

na_labels

Defaults to c("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
5
6
7
rescale_direction  (
column = c("In the right direction",
           "Things are going in the wrong direction",
           "In the wrong direction",
           "Thins are going in the right direction",
           "Neither the one or the other (SPONTANEOUS)",
           "Inap. (not 1 in eu28)", "DK"))

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