extract_vdem_filter: Extracts parts of the V-Dem dataset by passing a filter...

Description Usage Arguments Value Examples

View source: R/extractor_functions.R

Description

Extracts variables in the V-Dem dataset (version 11), by using a filter expression that is used to extract variable names from the V-Dem coddebook (vdem_codebook)

Usage

1
2
3
4
5
6
7
8
9
extract_vdem_filter(
  ...,
  include_uncertainty = TRUE,
  include_sd = FALSE,
  include_osp = FALSE,
  include_ord = FALSE,
  include_nr = FALSE,
  include_external = FALSE
)

Arguments

...

A sequence of filter expressions, separated by commas, suitable for use with dplyr::filter, operating on the column names of vdem_codebook. See examples.

include_uncertainty

Whether to return the uncertainty measurements for the selected variables (codelow and codehigh suffixes). Default is TRUE.

include_sd

Whether to return the standard deviation for the selected variables (sd suffix). Default is FALSE.

include_osp

Whether to return variables available in the original scale (osp suffix, linearized original scale posterior prediction). Default is FALSE.

include_ord

Whether to return variables available in an ordinal scale (ord suffix, measurement model estimates of original scale value). Default is FALSE.

include_nr

Whether to return the number of coders for the variable (nr suffix). Default is FALSE.

include_external

Whether to return variables marked "external", i.e., coming from an external source rather than V-Dem (e_ prefix). Default is FALSE.

Value

A tibble with the V-Dem country identifiers, other state system identifiers, plus the desired variables.

Examples

1
2
3
4
# All in section 2 of the codebook except component indexes
extract_vdem_filter(section == 2, !grepl("component index", label))
# All variables inclued in release 2 of the dataset
extract_vdem_filter(grepl("2(,|$)|1-11", data_release))

xmarquez/vdem documentation built on April 10, 2021, 8:31 a.m.