DDGet: Downloads the Democracy and Dictatorship data set

Description Usage Arguments Value See Also Examples

Description

Downloads the Democracy and Dictatorship data set. It keeps specified variables and creates a standard country ID variable that can be used for merging the data with other data sets. See the codebook at the authors' website https://sites.google.com/site/joseantoniocheibub/datasets/democracy-and-dictatorship-revisited (Direct link to codebook: http://uofi.box.com/shared/static/e6e312753fbc609fc379.pdf)

Usage

1
2
3
DDGet(url = "http://uofi.box.com/shared/static/bba3968d7c3397c024ec.dta",
  vars = NULL, OutCountryID = "iso2c", standardCountryName = TRUE,
  na.rm = TRUE, duplicates = "message", fromLast = FALSE)

Arguments

url

character string. The URL for the Democracy and Dictatorship data set you would like to download. Note: it must be for the Stata version of the file.

vars

character vector containing the variables to keep. If vars = NULL then the entire data set is returned. Note that the country and year variables are always returned.

OutCountryID

character string. The type of country ID you would like to include in the output file along with the country name. See countrycode for available options.

standardCountryName

logical. Whether or not to standardise the country names variable based on country.name from countrycode.

na.rm

logical. Drop observations where OutCountryID is NA.

duplicates

character specifying how to handle duplicated country-year observations. Can be set to none to do nothing, message to simply report duplicates, drop to report and drop duplicates, and return to return a data frame with only duplicated observations (see also fromLast).

fromLast

logical indicating if duplication should be considered from the reverse side. Only relevant if duplicates = 'drop' or duplicates = 'out'.

Value

a data frame

See Also

countrycode, CountryID

Examples

1
2
3
4
5
## Not run: 
# Download full data set
DDData <- DDGet()

## End(Not run)

psData documentation built on May 2, 2019, 3:39 p.m.