R/data.R

# Bundled example data ----------------------------------------------------------

#' Simulated subnational conflict events (Nigeria-like)
#'
#' A deterministic, seeded simulation of dyadic interaction events among 25 mobile
#' actors over 2000-2016, with the qualitative spatiotemporal structure that the PALS
#' method targets: actors drift slowly through space and interact preferentially with
#' nearby actors. It is produced by [simulate_conflict_events()] and is used in the
#' package examples, tests, and vignette so that they run without any external
#' dependency. It complements [nigeria_acled], the bundled real-data example.
#'
#' @format A [pal_events] object (a `data.frame` subclass) with 1500 rows and 5
#'   columns:
#' \describe{
#'   \item{actor1}{Character id of the first actor in the dyad.}
#'   \item{actor2}{Character id of the second actor in the dyad.}
#'   \item{time}{`Date` of the event.}
#'   \item{lon}{Event longitude (decimal degrees).}
#'   \item{lat}{Event latitude (decimal degrees).}
#' }
#'
#' @source Generated by `data-raw/nigeria_sim.R` via
#'   `simulate_conflict_events(n_actors = 25, n_events = 1500, years = 2000:2016,
#'   seed = 20230101)`.
#'
#' @examples
#' data(nigeria_sim)
#' nigeria_sim
#' \donttest{
#' fit <- estimate_pals(nigeria_sim, model = "one")
#' coef(fit)
#' }
"nigeria_sim"

#' Subnational conflict events in Nigeria
#'
#' Real dyadic conflict events in Nigeria, bundled from the replication archive for
#' the authors' study, Kim, Liu and Desmarais (2023). Each row is a recorded
#' interaction between two actors at a known date and location; this is the data on
#' which the PALS method was developed and validated.
#'
#' These data are part of the publicly available replication materials for that
#' study and can be downloaded directly from the Harvard Dataverse at
#' \doi{10.7910/DVN/NLWWPE}.
#'
#' @format A [pal_events] object (a `data.frame` subclass) with 1,549 rows and 5 columns:
#' \describe{
#'   \item{actor1}{Character name of the first actor in the dyad.}
#'   \item{actor2}{Character name of the second actor in the dyad.}
#'   \item{time}{`Date` of the event.}
#'   \item{lon}{Event longitude (decimal degrees).}
#'   \item{lat}{Event latitude (decimal degrees).}
#' }
#'
#' @source Public replication archive for Kim, Liu and Desmarais (2023), Harvard
#'   Dataverse, \doi{10.7910/DVN/NLWWPE}.
#'
#' @references Kim, S., Liu, H., and Desmarais, B. A. (2023). Spatial modeling of dyadic
#'   geopolitical interactions between moving actors. *Political Science Research and
#'   Methods*, 11(3), 633-644. \doi{10.1017/psrm.2022.6}
#'
#' @examples
#' data(nigeria_acled)
#' nigeria_acled
#' \donttest{
#' fit <- estimate_pals(nigeria_acled, model = "one")
#' coef(fit)
#' }
"nigeria_acled"

Try the palsr package in your browser

Any scripts or data that you put into this service are public.

palsr documentation built on July 1, 2026, 5:07 p.m.