Contentious Politics and Civil Conflict Research

Constructs reproducible country-year panels for research on contentious politics and civil conflict, as described in Guseinov (2026) . Functions build state panels keyed by Correlates of War or Gleditsch-Ward country codes and join curated socioeconomic, leadership, democracy, conflict, protest, and revolutionary-episode data on that common key, with diagnostics and plots for comparing source coverage. Bundled sources include Gapminder; the Nonviolent and Violent Campaigns and Outcomes (NAVCO) 2.1 data, Chenoweth and Shay (2019) ; the Social Conflict Analysis Database, Salehyan et al. (2012) ; the Uppsala Conflict Data Program and Peace Research Institute Oslo (UCDP/PRIO) Armed Conflict Dataset, Gleditsch et al. (2002) ; and the Major Episodes of Contention data, Chenoweth and Kang (2026) . Varieties of Democracy (V-Dem) indicators require the optional 'vdemdata' package, which is not on CRAN and can be installed from < https://github.com/vdeminstitute/vdemdata>.


contentiousR contentiousR logo

Lifecycle: experimental License: MIT R-CMD-check pkgdown

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.

Installation

# install.packages("remotes")
remotes::install_github("rguseinov/contentiousR")

Note: load_vdem_data() and add_vdem() require the vdemdata package, which is not on CRAN:

remotes::install_github("vdeminstitute/vdemdata")

Two workflows, your choice

contentiousR supports two ways of working - use them separately or together.

Pipeline workflow

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")

Standalone workflow

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.

Citation

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.

Acknowledgments

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.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("contentiousR")

0.1.0 by Ruslan Guseinov, 5 hours ago


https://rguseinov.github.io/contentiousR/, https://github.com/rguseinov/contentiousR


Report a bug at https://github.com/rguseinov/contentiousR/issues


Browse source code at https://github.com/cran/contentiousR


Authors: Ruslan Guseinov [aut, cre] (ORCID:


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports countrycode, dplyr, readr, states, stats, tidyr

Suggests brglm2, ggplot2, knitr, peacesciencer, readxl, rmarkdown, testthat, vdemdata


See at CRAN