MyNixOS website logo
Description

Diagnose, Visualize, and Aggregate Event Report Level Data.

Diagnose, visualize, and aggregate event report level data to the event level. Users provide an event report level dataset, specify their aggregation rules, and the package produces a dataset aggregated at the event level. Also includes the Modes and Agents of Election-Related Violence in Côte d'Ivoire and Kenya (MAVERICK) dataset, an event report level dataset that records all documented instances of electoral violence from the first multiparty election to 2022 in Côte d'Ivoire (1995-2022) and Kenya (1992-2022).

eventreport

The goal of the eventreport package is to diagnose, visualize, and aggregate event report level data to the event level. Users provide an event report level dataset, specify their aggregation rules, and the package produces a dataset aggregated at the event level. The package also allows the user to diagnose how sensitive their event report level data is to aggregation choices. In addition, the package includes the Modes and Agents of Election-Related Violence in Côte d’Ivoire and Kenya (MAVERICK) dataset, an event report level dataset that records all documented instances of electoral violence from the first multiparty election to 2022 in Côte d’Ivoire (1995-2022) and Kenya (1992-2022).

When using the data, please refer to the following article and codebook:

Sebastian van Baalen & Kristine Höglund (2026) Introducing the Modes and Agents of Election-Related Violence in Côte d’Ivoire (MAVERICK) datset. Journal of Peace Research, online first.

Sebastian van Baalen, David Edberg Landeström, Tor Richardson-Golinski & Kristine Höglund (2025) The MAVERICK Dataset Codebook Version 1.0. Uppsala: Department of Peace and Conflict Research, Uppsala University.

For methodological details, and when using the package, please refer to the following working paper:

Sebastian van Baalen & Kristine Höglund (2025) Trials and Triangulations: Analyzing Aggregation Sensitivity in Event Data on Political Violence. Uppsala: Department of Peace and Conflict Research, Uppsala University.

Installation

Once on CRAN, you can install the released version of eventreport from CRAN with:

#install.packages("eventreport")

You can also install the development version of eventreport from GitHub with:

# install.packages("devtools")
devtools::install_github("sebastianvanbaalen/eventreport")

What is event report level data?

Event report level data refers to data where each observation is an event that takes place on a single day and in a particular location as reported in a single source. The report level means that multiple reports about the same event constitute separate observations. For example, if both BBC and Reuters report about a violent post-election demonstration, the demonstration is the event, whereas the BBC and Reuters reports constitute the event reports. For a solid primer on event report level data, see this introduction to the method by Nils B Weidmann and Espen Geelmuyden Rød and this in-depth exploration of aggregation sensitivity by Scott J Cook and Nils B Weidmann.

The table below provides an example of event report level data from the MAVERICK dataset, and lists six unique reports about a single electoral violence event.

event_idcitylocationactor1actor1_typedeaths_bestsource
CIV-0004AbidjanAboboUnknown security force (Côte d’Ivoire)Security forces5Amnesty International (All Africa) (2011-01-12) Fresh Violence Erupts as Armed Groups Clash
CIV-0004AbidjanAboboUnknown security force (Côte d’Ivoire)Security forces1LEJD (2011-01-12) Nouveaux affrontements en Côte d’Ivoire
CIV-0004AbidjanUnknown security force (Côte d’Ivoire)Security forces5Reuters (2011-01-12) More die in Cote d’Ivoire violence
CIV-0004AbidjanAboboPolice (Côte d’Ivoire)Security forces6Xinhua News Agency (2011-01-12) Côte d’Ivoire : au total six policiers tués dans un quartier pro Ouattara à Abidjan
CIV-0004AbidjanPolice (Côte d’Ivoire)Security forces6Al Jazeera (2011-01-13) Tensions persist in Cote d’Ivoire
CIV-0004AbidjanAboboUnknown actor (Côte d’Ivoire)7The Times (2011-01-15) Coup fears as death toll rises

Why the eventreport package?

R already contains some functions that can be used for aggregating event report level data to the event level, such as the mean and median base R calls. However, as we detail in the package introduction article, the aggregation of event reports often demands additional functionalities, such as the use of tie-break rules or information contained in meta variables.

The eventreport package adds several functionalities not contained in existing software. Among those benefits, the package:

  • Handles different variable classes:eventreport handles a range of different variables, including character, date, numeric, and binary numeric variables. This feature makes the package ideal for working with event report datasets that include different variable classes.

  • Enables tie-breaking rules: many vectors are multi-modal, meaning that simple functions for identifying the most frequent values will yield multiple results. eventreport therefore enables users to specify up to two tie-breaking rules that help adjudicate between multiple modes variables.

  • Integrates precision scores: sometimes researchers are interested in recording the most precise value, such as more precise location estimates or more precise actor names. eventreport allows users to specify precision score variables that help prioritize what values to select when the values cannot be ranked.

  • Provides simple functions: aggregating event report level data is a complex coding project. eventreport makes this procedure more straightforward by providing simple functions that carry out complex tasks. All functions were developed in the context of a concrete event report level data collection effort, and are therefore both needs-based and well-tested.

  • Allows easy customization: the combination of simple functions and several convenience functions allows users to stipulate a range of complex aggregation rule sets with minimal coding. Moreover, because eventreport is tidyverse compatible, users can integrate the package functions in a tidy workflow.

Examples

We provide a host of examples in our vignette and in the MAVERICK dataset codebook. Below are three basic examples of the functionalities in the eventreport package.

For aggregation diagnostics, users can use mean_dscore to visualize the mean normalized divergence score per variable (the mean number of divergent values per event divided by the total number of unique values in each variable). This diagnostic helps users assess what and to what extent variables are sensitive to aggregation choices. Simply run:

mean_dscore(
  small_maverick_event_report,
  group_var = "event_id",
  variables = c("country", "actor1", "deaths_best", "injuries_best"),
  normalize = TRUE,
  plot = TRUE
)

For aggregating data, users can use calc_mode to find the mode value using two different tie-breaking rules:

calc_mode(
  c("Sweden", "Sweden", "Denmark", "Denmark"),
  tie_break = c(1, 1, 1, 1),
  second_tie_break = c(1, 4, 1, 1)
)
#> [1] "Sweden"

For aggregating entire dataframes, users can use aggregateData to stipulate a set of aggregation rules and aggregate the full dataset (here presented using the tidytable package):

output <- small_maverick_event_report %>% 
  aggregateData(
    group_var = "event_id",
    find_mode = "city"
) %>% 
utils::head(10)

tinytable::tt(output)
event_idcitynumber_of_sourcesunit_of_analysis
CIV-0001Duékoué5Event
CIV-00022Event
CIV-0003Abidjan12Event
CIV-0004Abidjan6Event
CIV-0008Man1Event
CIV-0009Vavoua2Event
CIV-0010Abidjan1Event
CIV-0011Yamoussoukro1Event
CIV-0012Gagnoa4Event
CIV-0013Daloa4Event.
Metadata

Version

0.1.1

License

Unknown

Platforms (76)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-linux
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows