Description Usage Arguments Value Examples
Recode a multiparty-variable in GESIS-Datasets such as the GERMAN LONGITUDINAL ELECTION STUDY (GLES)
1 2 3 4 5 |
year |
year the GLES-study is from. Defaults to 2017. |
dataset_input |
Character string of the name of a dataframe containing the raw data. |
dataset_output |
Character string of the name the output data frame (may already exist or not). |
varname |
Character string of the name of the original variable. |
own |
May apply: Different variable name for own position (on left-right scales, e.g.) |
varlabel |
Character string of the to-be-assigned variable label. |
key |
Character vector containing original alphabetic party keys. |
partynames |
Character vector containing shortname party keys. |
NAs |
Numeric vector containing to-be-assigned NAs/Missing values. |
plot |
Logical T/F: Show relative frequency barplots while plotting. |
A data frame containing output dataframe including newly appended new-variables.
1 2 3 4 5 6 7 8 | gles_recode_partyvar(year = 2017,
dataset_input = "gles2017",
dataset_output = "gles2017_out",
varname = "q52",
varlabel = "soz",
key = c("a","b","c","d","e","f","g"),
partynames = c("cdu","csu","spd","linke","gruene","fdp","afd"),
NAs = c(-97,-98,-99))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.