Constructs reproducible country-year panels for research on
contentious politics and civil conflict, as described in Guseinov (2026)

contentiousR is an R package that provides tools and datasets for contentious politics and civil conflicts research. It provides a flexible workflow for creating state panels and enriching them with socioeconomic, political, and conflict indicators — using either Correlates of War (COW) or Gleditsch-Ward (GW) country coding schemes.
# install.packages("remotes")
remotes::install_github("rguseinov/contentiousR")
Note:
load_vdem_data()andadd_vdem()require thevdemdatapackage, which is not on CRAN:remotes::install_github("vdeminstitute/vdemdata")
contentiousR supports two ways of working - use them separately or together.
Build a complete panel in one chain. Functions automatically detect the coding system and year range from the panel:
library(contentiousR)
library(dplyr)
panel <- build_states_panel(
start_year = 1990,
end_year = 2015,
coding_system = "cow"
) |>
add_gdp() |>
add_vdem(vars = c("v2x_polyarchy", "v2x_libdem", "v2x_rule")) |>
add_conflict(dataset = "navco2.1") |>
add_leader_data(dataset = "archigos")
Load each dataset independently for inspection or custom merging:
panel <- build_states_panel(1990, 2015, coding_system = "cow")
gdp_data <- load_gdp_data(1990, 2015, coding_system = "cow")
vdem_data <- load_vdem_data(
vars = c("v2x_polyarchy", "v2x_libdem"),
start_year = 1990,
end_year = 2015,
coding_system = "cow"
)
conflicts <- conflict_data(1990, 2015, dataset = "navco2.1", coding_system = "cow")
# Join on your own terms
panel <- panel |>
left_join(gdp_data, by = c("cow", "year")) |>
left_join(vdem_data, by = c("cow", "year")) |>
left_join(
conflicts |>
group_by(cow, year) |>
summarise(onset = max(nvc2.1_ONSET), .groups = "drop"),
by = c("cow", "year")
)
See the Get started
and Data sources and interpretation
articles for the full function walkthrough, dataset coverage tables, and
interoperability with peacesciencer.
If you use contentiousR in your research, please cite the accompanying
paper:
Guseinov, R. (2026). contentiousR: An R package for contentious politics and civil conflict research [Preprint]. SSRN. https://doi.org/10.2139/ssrn.7506799
@misc{guseinov2026contentiousr,
author = {Guseinov, Ruslan},
title = {{contentiousR}: An {R} Package for Contentious Politics and Civil Conflict Research},
year = {2026},
howpublished = {SSRN preprint},
doi = {10.2139/ssrn.7506799},
url = {https://ssrn.com/abstract=7506799}
}
To cite the software itself (e.g. to record the exact version used):
Guseinov, R. (2026). contentiousR: Contentious Politics and Civil Conflict Research. R package version 0.1.0. https://github.com/rguseinov/contentiousR
Please also cite every third-party data source used in an analysis —
contentiousR only assembles and reshapes this data, it does not replace
citing the original creators. cn_cite() looks up the bundled citation for
a function or dataset = value and prints it as ready-to-paste BibTeX:
cn_cite("navco2.1")
cn_cite("add_gdp()")
See the data-source guide
for versions, transformations, source links, and licensing notes, and
?cn_cite for the full lookup interface.
The package logo was generated with ChatGPT. Claude (Anthropic) was used to proofread the documentation and vignettes for grammatical and typographical errors and to refine the wording of several passages, and to review the package's R code.