Skip to contents

Returns the unique values of a given dimension across all observations of a GHO indicator. Useful for discovering which ages, sexes, regions, or other breakdowns are available before calling gho_data().

Usage

gho_dimensions(indicator, dimension = "SpatialDimType")

Arguments

indicator

Character scalar. The indicator code (e.g. "NCDMORT3070").

dimension

Character. Name of the dimension column in the indicator data. Common values include "SpatialDim", "SpatialDimType", "TimeDim", "Dim1", "Dim2", and "Dim3". Default "SpatialDimType".

Value

A character vector of unique, sorted dimension values, or an empty character vector when the service is unreachable or the dimension is missing.

Examples

# \donttest{
gho_dimensions("NCDMORT3070")
#> Fetching: <https://ghoapi.azureedge.net/api/NCDMORT3070>
#> [1] "COUNTRY"              "GLOBAL"               "REGION"              
#> [4] "WORLDBANKINCOMEGROUP"
gho_dimensions("NCDMORT3070", dimension = "Dim1")
#> Fetching: <https://ghoapi.azureedge.net/api/NCDMORT3070>
#> [1] "SEX_BTSX" "SEX_FMLE" "SEX_MLE" 
# }