ipc_get_points {ripc} | R Documentation |
Get points resources from the IPC API
Description
Accesses the points resources on the IPC API. Contains detailed area and
population data. If year
and/or type
parameters are passed, accesses
the types simplified API endpoint and pulls in all types data or filtered to
either year
or type
. To get all types for a specific analysis
and period, available on the types/{id}/{period} advanced API endpoint,
pass in id
and period
. You cannot pass in both sets of parameters.
Usage
ipc_get_points(
year = NULL,
type = NULL,
id = NULL,
period = NULL,
api_key = NULL,
tidy_df = TRUE
)
Arguments
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. |
period |
Period code, either 'C', 'P', or 'A' for current, projection, and second projection. |
api_key |
IPC API key. If |
tidy_df |
If |
Details
Points data is IPC data generated from analysis on geographic
entities that are smaller than the standard areas. These are typically
urban areas or displacement sites where food insecurity conditions might
differ significantly from the wider context and justify specific analysis.
Population estimates as well as an overall phase classification are provided
for each point. Data is currently output only for current
periods through the points endpoint. Use ipc_get_population()
to get
detailed population data and classifications for all analysis periods. Points
data is contained within the areas
dataset returned from
ipc_get_population()
.
See the IPC website and API documentation for more information.
Value
Data frame of IPC and CH analysis at the point level. 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 point analysis, and all estimates
and values are stored as columns:
All columns containing
phase
orpopulation
are converted to numeric.-
aar_id
is renamed toarea_id
andanl_id
toanalysis_id
.
Examples
# get all areas from the simplified API
ipc_get_points()
# get areas for specific analysis ID and period from advanced API
ipc_get_points(id = 18978466, period = "P")