Description Usage Arguments Value Examples
View source: R/extractor_functions.R
Extracts variables in the V-Dem dataset (version 11), according to the section number in the codebook or a regular expression pattern matching the name or the label.
1 2 3 4 5 6 7 8 9 10 11 |
section_number |
A section number (or vector of section numbers) in the
V-dem codebook. Must be an integer or an integer vector (e.g., |
name_pattern |
A character pattern, interpreted as a regular expression, to search over the V-dem variable names, e.g., "v2x" extracts all variables including the string "v2x" in their names. |
label_pattern |
A character pattern, interpreted as a regular expression, to search over the V-dem labels, e.g., "corrupt" extracts all variables that mention "corrupt" in their label. |
include_uncertainty |
Whether to return the uncertainty measurements for
the selected variables ( |
include_sd |
Whether to return the standard deviation for the selected
variables ( |
include_osp |
Whether to return variables available in the original
scale ( |
include_ord |
Whether to return variables available in an ordinal scale
( |
include_nr |
Whether to return the number of coders for the variable
( |
include_external |
Whether to return variables marked "external", i.e.,
coming from an external source rather than V-Dem ( |
A tibble with the V-Dem country identifiers, other state system identifiers, plus the desired variables.
1 2 3 4 5 6 7 8 9 10 11 12 | # Main democracy indexes
extract_vdem(section_number = 2)
# Mid-level indexes, no measures of uncertainty
extract_vdem(section_number = 3, include_uncertainty = FALSE)
# All indexes about corruption
extract_vdem(label_pattern = "corrupt")
# All indexes about elections, include external indexes
extract_vdem(label_pattern = "elect", include_external = TRUE)
# All civil liberties indexes, include original scale prediction
extract_vdem(name_pattern = "^v2cl", include_osp = TRUE)
# Combine section and label patterns
extract_vdem(section_number = 1, label_pattern = "elect", include_external = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.