prep_vdem: Prepare V-Dem Data

View source: R/prep_vdem.R

prep_vdemR Documentation

Prepare V-Dem Data

Description

Given a raw data.frame of vdem data, enact further automated pre-processing.

Usage

prep_vdem(
  vdem,
  years = NULL,
  metrics = NULL,
  drop_no_cow = FALSE,
  cow_index = FALSE,
  drop_pal = FALSE,
  srb_kos = FALSE,
  srb_mon = FALSE,
  micro = TRUE,
  iso3 = FALSE
)

Arguments

vdem

A data.frame or data.table of raw vdem observations.

years

A numeric vector of length 2 with start and end years to subset by.

metrics

Character vector of vdem metrics of interest to subset against. These will be combined with country-year id variables by default.

drop_no_cow

Logical to drop observations without Correlates of War country codes.

cow_index

Logical to index vdem against valid Correlates of War country-years.

drop_pal

Logical to remove all Palestine related observations.

srb_kos

Logical to average metrics Serbia/Yugoslavia with Kosovo for all years < 2008.

srb_mon

Logical to calculate values for the State Union of Serbia and Montenegro (2003-2006) using the average of Serbia's and Montenegro's scores. To include Kosovo, specify srb_kos = TRUE.

micro

Logical to keep (TRUE) or drop (FALSE) microstates.

iso3

Logical to generate ISO3C country codes.

Value

A data.frame of post-processed vdem data.

Examples


vdem<-demcon::get_vdem(write_out = FALSE)

vdem<-prep_vdem(vdem, years = c(2010, 2020), cow_index = TRUE, micro = FALSE)


demcon documentation built on March 31, 2023, 10:27 p.m.