Downloads the Polity IV 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
PolityGet(
url = "http://www.systemicpeace.org/inscr/p4v2015.sav",
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: it must be for the SPSS version of the file.
- vars
character vector containing the variables to keep. If
vars = NULLthen the entire data set is returned. Note that thecountryandyearvariables 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
countrycodefor available options.- standardCountryName
logical. Whether or not to standardise the country names variable based on
country.namefromcountrycode.- na.rm
logical. Drop observations where
OutCountryIDisNA.- duplicates
character specifying how to handle duplicated country-year observations. Can be set to
noneto do nothing,messageto simply report duplicates,dropto report and drop duplicates, andreturnto return a data frame with only duplicated observations (see alsofromLast).- fromLast
logical indicating if duplication should be considered from the reverse side. Only relevant if
duplicates = 'drop'orduplicates = 'out'.
See also
countrycode, CountryID,
WinsetCreator
