ipc_get_icons {ripc}R Documentation

Get icons resources from the IPC API

Description

Accesses the icons resources on the IPC API. Contains links from analysis and area IDs to the icon resource the IPC uses in maps and publications. This is likely not useful for the general user. If year and/or type parameters are passed, accesses the icons simplified API endpoint, pulls in data filtered to those parameters. To get all icons 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_icons(
  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 NULL, the default, returns data for all years.

type

Single string value of 'A' or 'C', corresponding to food security conditions, either acute or chronic. If NULL, the default, returns data for all types.

id

Analysis ID.

period

Period code, either 'C', 'P', or 'A' for current, projection, and second projection.

api_key

IPC API key. If NULL (the default), looks for IPC_API_KEY in the environment.

tidy_df

If TRUE, returns a tidy data frame wrangled as described in the Tidy section of the documentation. If FALSE, returns the data frame as returned direct from the IPC-CH API.

Details

Icons data is used internally by the IPC to link up analyses for areas and a relevant icon for display on maps and in publications. The icons are stored in an Amazon S3 bucket that is not publicly accessible and therefore not useful for general users. Provided here for convenience.

See the IPC website and API documentation for more information.

Value

Data from of icons for analysis publications. 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, aar_id is renamed to area_id and area to area_name.

Examples



# get all icons from the simplified API
ipc_get_icons()

# get icons for specific analysis ID and period from advanced API
ipc_get_icons(id = 12135625, period = "C")


[Package ripc version 0.3.0 Index]