Description Usage Arguments Details Value Author(s) Examples
View source: R/ESPEN_API_data.R
Allows users to request data for countries through the ESPEN API. Users provide parameters as specified in <https://admin.espen.afro.who.int/docs/api/data> or as described below and the function returns a JSON string or data frame.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
api_key |
the API key from ESPEN. You can request the key from ESPEN portal. We reccomend to set up the API key in the R environment as shown in the github repository. In this case you won't need to use this argument. |
country |
the name of the country. E.g 'Ghana' |
iso2 |
optional: country ISO2 code, e.g. 'GH'. you can either specify a country name or the ISO2 code |
disease |
specify the disease of interest, options are lf , oncho , loa , sch , sth , trachoma , coendemicity |
level |
specify which the level of the data, options are 'iu' and 'sitelevel'. iu means implemantation unit. |
type |
logical: should you want a forcast of MDA or impact assessment. default is FALSE. |
subtype |
only use when type =TRUE, options are mda and impact_assessment. |
start_year |
specify the starting year of the data, e.g start_year = 2010 |
end_year |
specify the starting year of the data, e.g end_year = 2020 |
limit |
to specify how many records to return |
offset |
to specify how many records to skip |
attributes |
options are IU_ID, Endemicity, MDA, EffMDA. This is basically used to reduce the data. |
df |
logical: should the function return a dataframe (default) or list containing of the JSON strings. |
See <https://espen.afro.who.int/tools-resources/download-data> for more details on the data available.
A dataframe or JSON file of the data
Olatunji Johnson o.johnson@lancaster.ac.uk
1 2 3 4 5 | library(ESPENAPI)
# extract the STH data from Kenya at site level for year 2010.
data <- ESPEN_API_data(country="Nigeria", disease="sth",
level="sitelevel", start_year=2010, end_year=2010)
head(data)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.