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
ordata.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.