Description Usage Arguments Examples
The Eurobarometer occupations have three groups: none-active, self-employed,
and employed occupations. If you only need this categorization, you should
use the recatogorized version of this variable.
The numeric recategorization keeps this grouping, giving numeric representations
starting with digit 1 for none-active, 2 for self-employed
and 3 for employed respondents. Keeping only the first digit
will re-create the recoded version of this variable. The second digit is a unique
numeric identifier, but the ordering of the numeric variable, or the differences between
numeric codes have little if any meaning. This is a truly categorical variable.
The return_class="factor" and return_class="character" give shorthened
versions of the GESIS labels for easier handling in R.
This is a wrapper function around the rescale_categories function.
1 2 | rescale_occupation(column, from = NULL, to = NULL,
na_labels = c("default"), return_class = "factor", underscore = TRUE)
|
column |
A column from a survey data with the subjective urbanization answers. |
from |
Defaults to |
to |
Defaults to |
na_labels |
Defaults to |
return_class |
Default is |
underscore |
Defaults to |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | rescale_occupation (c("Owner of a shop, craftsmen, etc.",
"Retired, unable to work",
"Employed position, at desk",
"Employed professional (employed doctor, etc.)",
"DK"),
return_class = "character")
##Nicer printing factor names without underscore:
rescale_occupation (c("Owner of a shop, craftsmen, etc.",
"Retired, unable to work","DK"),
underscore = FALSE)
##Beware that the numeric representation is grouped but not ordered.
rescale_occupation (c("Owner of a shop, craftsmen, etc.",
"Retired, unable to work",
"Employed position, at desk",
"Employed professional (employed doctor, etc.)",
"DK"),
return_class = "numeric")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.