code_states: Code Agreement Parties

View source: R/code_agreements.R

code_statesR Documentation

Code Agreement Parties

Description

Identify the countries that are part of an agreement.

Usage

code_states(title, activity = TRUE, replace = NULL)

Arguments

title

A character vector of treaty titles

activity

Do you want the activity of treaty to be coded? By default, TRUE.

replace

Do you want the state name or abbreviation to be returned? By default, NULL. Other options include, "names", for the state name, or "ID", for the 3 letter state abbreviation.

Details

The function codes states in treaty titles. The function also returns the "activity" for bilateral treaties coded, if activity is TRUE. Bilateral agreements usually detail their activity and specify area in the last words of the titles. These last words are abbreviated by the function to differentiate between bilateral treaties and avoid false positives being generated since multiple, different, bilateral treaties are often signed in the same day. For the complete list of parties coded please run the function without an argument (i.e. code_states()).

Value

A character vector of parties that are mentioned in the treaty title

Examples

## Not run: 
IEADB <- dplyr::slice_sample(manyenviron::agreements$IEADB, n = 10)
code_states(IEADB$Title)
code_states(IEADB$Title, activity = FALSE)
code_states(IEADB$Title, activity = FALSE, replace = "names")
code_states(IEADB$Title, activity = FALSE, replace = "ID")

## End(Not run)

globalgov/qCreate documentation built on April 27, 2023, 3:27 a.m.