DpiGet {psData} | R Documentation |
Downloads the Database of Political Institutions (DPI)
Description
Downloads the Database of Political Institutions (DPI) 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.
Usage
DpiGet(url, vars = NULL, OutCountryID = "iso2c",
standardCountryName = TRUE, na.rm = TRUE, duplicates = "message",
fromLast = FALSE)
Arguments
url |
character string. The URL for the Polity IV data set you would like to download. Note this is exclusively to download previous, IMF hosted, versions of the data set. If a value is not supplied, then the 2015 IDB hosted version will be downloaded. If a link is supplied it must be to a Stata formated file. |
vars |
character vector containing the variables to keep. If
|
OutCountryID |
character string. The type of country ID you would like
to include in the output file along with the country name. See
|
standardCountryName |
logical. Whether or not to standardise the country
names variable based on |
na.rm |
logical. Drop observations where |
duplicates |
character specifying how to handle duplicated country-year
observations. Can be set to |
fromLast |
logical indicating if duplication should be considered from
the reverse side. Only relevant if |
Value
a data frame
See Also
countrycode
, CountryID
,
WinsetCreator
Examples
## Not run:
# Download full data set
DpiData <- DpiGet()
# Create data frame with only the military variable
DpiSub <- DpiGet(vars = 'military',
OutCountryID = 'imf')
## End(Not run)