knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

states

CRAN versions Coverage status R-CMD-check

Create country-year/month/day panels consistent with the COW or Gleditsch & Ward lists of independent states. I mainly use this for merging different data sources:

  1. Create a master template that reflects one of the independent states lists.
  2. For each data source, normalize to a copy of the master template. Doing this by source makes it easier to identify and address issues like missing values or observation for non-independent states.
  3. In the end, merge everything together. Since all the inputs are already normalized to a proper state panel list, there should be no issues.

What the package does:

library("states")

data(gwstates)
data(cowstates)
sfind(260)[, 1:6]
sfind("German")[, 1:6]
countries <- state_panel(1991, 2001)

str(countries)
data("polity")
str(polity)

plot_missing(polity, x = "polity", ccode = "ccode", statelist = "COW")

For the underlying data (missing info requires date input):

polity$date <- as.Date(paste0(polity$year, "-01-01"))
mm <- missing_info(polity, x = "polity", ccode = "ccode", 
                   time = "date", period = "year",
                   statelist = "COW")
head(mm)

Install

The package is on CRAN and can be installed with:

install.packages("states")

Or to install from GitHub:

library("remotes")
remotes::install_github("andybega/states")

Citations

For the Gleditsch and Ward (G&W) state data:

Gleditsch, Kristian S. & Michael D. Ward. 1999. "Interstate System Membership: A Revised List of the Independent States since 1816." International Interactions 25: 393-413.

For the Correlates of War (COW) state data:

Correlates of War Project. 2017. "State System Membership List, v2016." Online, https://correlatesofwar.org



andybega/states documentation built on Sept. 11, 2023, 4:04 p.m.