add_minimum_distance: Add minimum distance data to your data frame

View source: R/add_minimum_distance.R

add_minimum_distanceR Documentation

Add minimum distance data to your data frame

Description

add_minimum_distance() allows you to add the minimum distance (in kilometers) to a (dyad-year, leader-year, leader-dyad-year, state-year) data frame. These estimates are recorded in the cow_mindist and gw_mindist data that come with this package. The data are current as of the end of 2019.

Usage

add_minimum_distance(data)

Arguments

data

a data frame with appropriate peacesciencer attributes

Details

The function leans on attributes of the data that are provided by one of the "create" functions in this package (e.g. create_dyadyear() or create_stateyear()).

Value

add_minimum_distance() takes a (dyad-year, leader-year, leader-dyad-year, state-year) data frame and adds the minimum distance between the first state and the second state (in dyad-year data) or the minimum minimum (sic) distance for a given state in a given year.

Author(s)

Steven V. Miller

References

Schvitz, Guy, Luc Girardin, Seraina Ruegger, Nils B. Weidmann, Lars-Erik Cederman, and Kristian Skrede Gleditsch. 2022. "Mapping The International System, 1886-2017: The CShapes 2.0 Dataset." Journal of Conflict Resolution. 66(1): 144-161.

Weidmann, Nils B. and Kristian Skrede Gleditsch. 2010. "Mapping and Measuring Country Shapes: The cshapes Package." The R Journal 2(1): 18-24.

Examples



# just call `library(tidyverse)` at the top of the your script
library(magrittr)
cow_ddy %>% add_minimum_distance()

create_dyadyears(system = "gw") %>% add_minimum_distance()

create_stateyears(system ="gw") %>% add_minimum_distance()




peacesciencer documentation built on March 31, 2023, 8:37 p.m.