library(rgho)

rgho is an R package to access WHO GHO data from R via the Athena web service, an API providing a simple query interface to the World Health Organization's data and statistics content.

The Global Health Observatory

As stated by the WHO website: The GHO data repository contains an extensive list of indicators, which can be selected by theme or through a multi-dimension query functionality. It is the World Health Organization's main health statistics repository.

Data structure

GHO data is composed of indicators structured in dimensions. The list of dimensions is available in vignette("b-dimensions", "rgho"), the list of indicators for the GHO dimension (the main dimension) in vignette("c-codes-gho", "rgho")).

It is possible to access dimensions with get_gho_dimensions():

get_gho_dimensions()

And codes for a given dimension with get_gho_codes():

get_gho_codes(dimension = "COUNTRY")
get_gho_codes(dimension = "GHO")

The number of printed items can be changed by the option rgho.n.

Search

The function search_dimensions() and search_codes() research a term in dimension or codes labels, respectively.

search_dimensions("region")
search_codes("neonatal", dimension = "GHO")

It is also possible to search results from an existing object.

result <- get_gho_codes(dimension = "REGION")
search_gho(result, "asia")

Filtering results

Dimension codes can be filtered according to their attributes.

results <- get_gho_codes(dimension = "COUNTRY")

filter_gho(
  results,
  WHO_REGION_CODE == "EUR"
)

Attribute names and values can be displayed.

display_attributes(
  results
)
display_attribute_values(
  results,
  "WHO_REGION_CODE"
)

Data download

An indicator can be downloaded as a data_frame with get_gho_data(). Here we use MDG_0000000001, Infant mortality rate (probability of dying between birth and age 1 per 1000 live births):

result <- get_gho_data(
  dimension = "GHO",
  code = "MDG_0000000001"
)

print(result, width = Inf)

Filter requests

The filter argument in get_gho_data() allows request filtering:

result <- get_gho_data(
  dimension = "GHO",
  code = "MDG_0000000001",
  filter = list(
    REGION = "EUR",
    YEAR = "2015"
  )
)

print(result, width = Inf)

Other parameters

Other parameters than format can be specified to get_gho_data() (such as apikey, asof...). Parameters are listed on this page. Note that most parameters are not available to general users.

For details about how the requests are performed and the option availables (especially proxy settings) see vignette("e-details", "rgho").



pierucci/rgho documentation built on May 25, 2019, 7:11 a.m.