Skip to content

contentiousR

0.1.0Package record

Contentious Politics and Civil Conflict Research

0packages depend
202downloads / year
88.1%test coverage
13/13flavors OK

Overview

About

Constructs reproducible country-year panels for research on contentious politics and civil conflict, as described in Guseinov (2026) doi:10.2139/ssrn.7506799. 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) doi:10.7910/DVN/MHOXDV; the Social Conflict Analysis Database, Salehyan et al. (2012) doi:10.1080/03050629.2012.697426; the Uppsala Conflict Data Program and Peace Research Institute Oslo (UCDP/PRIO) Armed Conflict Dataset, Gleditsch et al. (2002) doi:10.1177/0022343302039005007; and the Major Episodes of Contention data, Chenoweth and Kang (2026) doi:10.1093/jopres/xjaf008. 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.

Changes in 0.1.0

Changes made for CRAN

  • The package title is now "Contentious Politics and Civil Conflict Research".
  • cn_cite() now returns its result visibly instead of printing it with cat(). The result is a bibentry object with the additional class cn_citation; typing cn_cite("archigos") at the console still shows the BibTeX, and print() shows it explicitly.
  • The bundled data files are smaller (tarball 4.3 MB): they keep only the columns the package reads, and the MEC and NMC Stata files are stored as compressed .rds. Loader output is unchanged. 'haven' is no longer used.
  • citation("contentiousR") now lists the SSRN preprint describing the package, followed by the software citation.
Show all changes in 0.1.0Hide the rest of the changes in 0.1.0

Bug fixes

  • load_vdem_data(coding_system = "cow") no longer silently drops East Germany (COW 265, 1949-1990); it was previously excluded only in the "cow" branch, so V-Dem coverage for Germany differed depending on the chosen coding system with no indication why.
  • add_spell_duration() now computes spells from the actual calendar-year difference instead of row position within a state. A gap in the input years (e.g. left by tidyr::drop_na(event), which the package's own examples recommend) previously understated the elapsed time.
  • plot_coverage() now errors with a clear message instead of crashing when drop_empty = TRUE removes every state (e.g. the chosen event never occurs in the supplied panel/year range).
  • cn_cite() matched keywords by substring, so a short dataset name (e.g. "mm") could also match an unrelated entry whose keyword merely contained it as a substring ("mmad"). Keyword matching is now exact against the comma-separated keyword list.
  • harmonize_conflict_data(): a factor year_col was coerced with as.integer(), which returns the factor's internal level codes rather than the printed year. It is now converted to character first. A date_col that fails to parse (e.g. a non-ISO format without a matching date_format) now raises a clear error instead of a generic base-R one.

Bring your own data

  • Added harmonize_conflict_data() to join externally supplied conflict/ event data (GDELT, ICEWS, ACLED, or anything else not bundled with contentiousR) onto a state panel: it maps the caller's country column to COW/GW codes via countrycode::countrycode(), extracts a year from either a pre-parsed year_col or a date_col/date_format, optionally aggregates event-level rows to country-year (<prefix>_onset, <prefix>_n_events), and joins the result in. Unlike add_conflict(), it never downloads or bundles data itself, so contentiousR gains no dependency on gdeltr2, icews, or acled.api.

Visualization

  • plot_coverage() gained a show_labels argument (default TRUE). Set it to FALSE to drop the per-row country/code labels, which otherwise overlap and become illegible once the panel covers more than a few dozen states.
  • plot_regional_coverage()'s region labels are now horizontal and word-wrapped instead of angled, and its region field's canonical "Middle East" label is the shorter "Middle East & North Africa" form. plot_temporal_coverage()'s period labels are now vertical instead of angled. Both plots no longer set a ggplot2 title (redundant with a caption in a manuscript).
  • Added plot_regional_coverage() and plot_temporal_coverage() to compare regional and temporal event coverage across any combination of conflict_data() campaign/episode datasets, plus a "Comparing revolutionary-event datasets" article reproducing the descriptive exercise in Guseinov, Ustyuzhanin & Korotayev (2026).
  • Added add_regions() to join one or more countrycode region classifications (region, region23, un.region.name, un.regionsub.name) onto a state panel by cow/gw code.

Data

  • Added the Major Episodes of Contention (MEC) dataset: 2,734 globally covered reformist and maximalist episodes from 1955 through 2018. MEC is available through conflict_data(dataset = "mec") and add_conflict(dataset = "mec"). Episode-level rows are preserved unless the existing aggregate = TRUE policy is requested.

Correctness

  • fetch_campaign_events() (used by plot_regional_coverage() and plot_temporal_coverage()) now compares NAVCO 2.1 at the same campaign-onset level as the other datasets, using conflict_data()'s own nvc2.1_ONSET flag (keyed on the numeric campaign id) instead of re-deriving onsets from the campaign name, which is not unique and could silently merge distinct campaigns that happen to share a name.
  • fetch_campaign_events()'s region field now stays at exactly 7 categories. countrycode::countrycode()'s "region" destination labels a few pre-1990 historical entities (Yemen Arab Republic, Yemen People's Republic, the United Arab Republic) with the World Bank's older "Middle East & North Africa" string while every other MENA country gets the newer "Middle East, North Africa, Afghanistan & Pakistan" string; since campaign data covering the 1950s-80s includes those historical codes, the region was silently splitting into two bars in plot_regional_coverage()/plot_temporal_coverage().
  • gdp_growth (load_gdp_data(), dataset = "gapminder") is now NA unless the preceding row is genuinely one year earlier for the same country, the same gap-safety check add_lag() uses.
  • Removed add_pop(). It was an exact duplicate of add_population() (same body, same arguments, two visually identical Reference entries) and every other add_*()/load_*_data() pair in the package already shares one name (add_vdem()/load_vdem_data(), add_leader_data()/load_leader_data(), etc.) -- add_population() is the one that matches load_population_data(). Use add_population() instead.
  • Renamed add_spells() to add_spell_duration() to stop it silently shadowing (or being shadowed by) peacesciencer::add_spells() when both packages are attached in the same session -- the two are similar in spirit but not interchangeable (contentiousR's version works on any binary _onset/_incidence/_ongoing column, not a fixed set of bundled columns).
  • conflict_data() now applies start_year and end_year consistently to every bundled source.
  • UCDP/PRIO output now distinguishes conflict incidence from episode onset. ucdp_prio_onset is based on start_date2; the new ucdp_prio_incidence column identifies all active conflict-years.
  • SCAD country-year totals now exclude UCDP placeholder records, deduplicate multi-location rows by event ID, and treat documented negative death-count codes as missing.
  • All-missing groups now produce NA instead of -Inf, NaN, and associated warnings during conflict aggregation.
  • Mass Mobilization participant strings are retained in mm_participants_reported; mm_participants summarizes only exact numeric reports.
  • add_conflict() no longer re-aggregates sources that are already unique by country-year, preventing character-valued source fields from being dropped.

API and robustness

  • Added as_peacesciencer_panel() to supply the state-year key aliases and metadata required by peacesciencer while preserving contentiousR's API.
  • Added add_from_peacesciencer() to apply a state-year peacesciencer function while keeping temporary ccode/gwcode keys out of the result.
  • build_states_cow_panel() is internal again (not exported). It's the actual COW-panel implementation build_states_panel(coding_system = "cow") dispatches to, but there's no public reason to call it directly instead of build_states_panel() -- and its GW counterpart, build_states_gw_panel(), was never exported in the first place.
  • Added strict validation for years, logical flags, panel keys, and output-key uniqueness.
  • build_states_panel() now validates start_year/end_year against the Correlates of War / Gleditsch-Ward state system's actual coverage: 1816-2025.
  • Added ucdp_vpp_incidence. The existing ucdp_vpp_onset column remains as a compatibility alias and is now documented as incidence rather than onset.
  • Removed the magrittr dependency in favor of R's native pipe.

Release infrastructure

  • Added broader test coverage, two introductory vignettes, package-level documentation, data provenance and licensing notes, pkgdown configuration, and GitHub Actions for package checks and site deployment.
  • Added a case study article assembling a panel and modeling revolutionary onset, and a "Comparing revolutionary-event datasets" article (see Visualization above).
  • Added a package logo, shown in the README and the pkgdown site navbar.
  • Added formal References sections to load_gdp_data()/add_gdp(), load_population_data()/add_population(), load_military_expenditure_data()/add_military_expenditure(), load_vdem_data()/add_vdem(), conflict_data()/add_conflict(), load_leader_data()/add_leader_data(), and plot_regional_coverage()/plot_temporal_coverage(), citing the underlying data source(s) for each.
  • Corrected the SCAD citation's DOI (in DESCRIPTION and the bundled bibliography behind cn_cite()): the previous DOI did not resolve.

From NEWS.md in the release

Install

Health

CRAN checks
13OK
Slowest check: 5.4 min · r-oldrel-macos-x86_64
Status changes
  • OK13 OKNow
  • OK6 OK2026-10-16
Advisories

none known

Documentation

In release 0.1.0
READMEYes · 319 wordsVignettesYes · 4 · dynamicNEWSYes · 67% structured · mentions 0.1.0Citation fileYes · software entry onlyWebsiteYes · pkgdown
Help pages
40 (16 internal)includes a package overview page
Examples that run
100%22 run in a plain check (6 of them under a condition)
Exported functions with examples
96%
Documented parameters
96%
Return-value docs
100%
Help pages citing references
35%

Downloads

202
CRAN downloads in the past year
Rank #25,496 · ~1/day · ~17/mo
Daily download trend is not available in this view yet.
20230 days
20290 days
2021 year
Compare downloads with other packages →
Also on1 autocran

Repository

6Stars
0Forks
1Open issues
0Open PRs
0Releases
1Commits
1Commit identities
1 commits · Last activity 2026-10-15 · +500% stars, 30d
Responsiveness
not measured

Stars over time

2026-10-16 · 12026-10-19 · 6
PracticesBeta

11 development-tooling and community-health practices detected across 6 families in the upstream repository

Checks run against github.com/rguseinov/contentiousr on 2026-10-21.

Continuous integration (2)
GitHub ActionsR CMD check workflow

The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel

Governance and community (1)
Contributing guide
Docs source (3)
pkgdown

GitHub Pages site last deployed 2026-10-15 · The repository has a site deploy workflow

pkgdown site last built 2026-10-15

Reproducibility and dev environment (1)
data-raw/
Show all practicesHide 2 practices
CRAN release process (2)
cran-comments.mdCRAN-SUBMISSION
Lint, format, editor (2)
lintrRStudio project
How this is detected·Detection ruleset v4 (2026-10-20)

Dependencies

Declared dependencies
13 external dependencies (excludes base and recommended)

Installing contentiousR adds 32 packages (17 with compiled code, 21 MB of source tarballs). Heaviest: stringi 11 MB, vctrs 1.0 MB, dplyr 902 KB.

Depends (1)
R >= 4.1.0
LinkingTo (0)
none
Enhances (0)
none
Reverse dependencies
0direct
0indirect

Nothing depends on this yet.

Datasets

People & History

People (1)
Author, Maintainer since 0.1.0 (2026)
Releases (1)
  • 0.1.0Latest
    2026-10-15 · current release ·
    12 days in CRAN's queue
    Listed in CRAN's incoming queue from 2026-10-03 21:57 to 2026-10-15 12:21 UTC, in 52 readings.
  • R
    R 4.6.0 released · 2026-04-24
Across CRAN, the median accepted release of the past year spent 26 hours in the queue, 90% under 11 days.How queue time is measured

Package metadata

First published
2026-10-15
Total releases
1 / 1 yrs
License
MIT + file LICENSE OSI
Copyright
See file COPYRIGHTS for the third-party data bundled in inst/extdata.
Minimum R
≥ 4.1.0
Bundled data
3.7 KB / 1 file
Download size
4.3 MB

Cite

Cite this package

Run in R for the authors' entry:

citation("contentiousR")

The package provides a citation file, so citation() returns the authors' own entry.

It points to 10.2139/ssrn.7506799.

Cite the R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for contentiousR version 0.1.0 [Data set]. HJJB, LLC. Data release v2026-10-25. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-25, which the citation names so these numbers can be found later. More on citing and the projects behind them.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy