mp_maindataset | R Documentation |
Gets the Manifesto Project's Main Dataset from the project's web API or the local cache, if it was already downloaded before.
mp_maindataset(
version = "current",
south_america = FALSE,
download_format = NULL,
apikey = NULL,
cache = TRUE
)
mp_southamerica_dataset(...)
version |
Specify the version of the dataset you want to access. Use
"current" to obtain the most recent, or use
|
south_america |
flag whether to download corresponding South America dataset instead of Main Dataset. This parameter deprecated as the previously separated South America Dataset has been integrated into the Main Dataset from version 2023a onwards. To allow for backward compatibilty old South American Datasets can still be accessed but querying for the most recent South American Dataset will result in an empty dataset. |
download_format |
Download format. If not NULL, instead of the dataset
being returned as an R data.frame, a file path to a temporary file in the specified
binary format is returned. Can be one of |
apikey |
API key to use. Defaults to |
cache |
Boolean flag indicating whether to use locally cached data if available. |
... |
all arguments of |
mp_southamerica_dataset
is a shorthand for getting the Manifesto
Project's South America Dataset (it is equivalent to
mp_maindataset(..., south_america = TRUE)
). It is nowadays deprecated, for
details see explanation in 'south_america' parameter documentation.
The Manifesto Project Main Dataset with classes data.frame
and
tbl_df
## Not run:
mpds <- mp_maindataset()
head(mpds)
median(subset(mpds, countryname == "Switzerland")$rile, na.rm = TRUE)
## End(Not run)
## Not run:
mp_maindataset(download_format = "dta") %>% read_dta() ## requires package haven
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.