rescale_subjective_urbanization: Rescale the Eurobarometer subjective urbanization variable

Description Usage Arguments Examples

Description

Rescaling the Eurobarometer subjective urbanization variable.

Usage

1
2
rescale_subjective_urbanization(column, from = NULL, to = NULL,
  exact_from = TRUE, na_labels = c("default"), return_class = "factor")

Arguments

column

A column from a survey data with the subjective urbanization answers.

from

Defaults to c("NULL") in which case the GESIS coding in English c("Rural area or village","Small or medium-sized town", "Large town/city") will be used.

to

Defaults to NULL in which case the GESIS coding will be shortened to c("rural", "town", "city"). If you choose return_class = "numeric" the default to parameter changes to c(0,1,2).

exact_from

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

na_labels

Defaults to c("default").

return_class

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
rescale_subjective_urbanization (c("Rural area or village",
                                   "Large town/city",
                                   "Small or medium-sized town",
                                   "DK"),
                                 return_class = "numeric")

## Default return changes if the returned value is coded as numeric.

rescale_subjective_urbanization (c("Rural area or village",
                                   "Large town/city",
                                   "Small or medium-sized town",
                                   "DK"),
                                 return_class = "numeric")

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