ipc_get_analyses {ripc} | R Documentation |
Get analyses resources from the IPC API
Description
Accesses the areas resources on the IPC API. Contains detailed analysis
information. If country
, year
and/or type
parameters are passed,
accesses the analyses simplified API endpoint and pulls in all analyses or
filtered to those parameters. To get the details for a specific analysis
available on the analyses/{id}/{period} advanced API endpoint,
pass in id
. You cannot pass in both sets of parameters.
Usage
ipc_get_analyses(
country = NULL,
year = NULL,
type = NULL,
id = NULL,
api_key = NULL,
tidy_df = TRUE
)
Arguments
country |
ISO2 country code. |
year |
Single numeric year to filter analysis, calculated from the
maximum year of current period dates. If |
type |
Single string value of 'A' or 'C', corresponding to food security
conditions, either acute or chronic. If |
id |
Analysis ID. |
api_key |
IPC API key. If |
tidy_df |
If |
Details
Analyses data is metadata related to specific analyses conducted by the IPC, including title of the analysis, link to its release page on the IPC website, and creation/modification dates.
Value
Data frame of analysis metadata. Refer to the IPC-CH Public API documentation for details on the returned values, with variables described in full in the extended documentation.
Tidy
When tidy_df
is TRUE
, the following changes are made to the initial
output to ensure each row represents a single analysis:
The data is arranged by
country
,year
, andcreated
.-
id
column is renamed to beanalysis_id
.
Examples
# get all analyses details from the simplified API
ipc_get_analyses()
# get analysis details for a specific analysis ID
ipc_get_analyses(id = 12856213)