Data Science Infrastructure for Global Health in R
An R package providing a publication-ready ggplot2 theme,
flextable defaults, a pie-chart helper, built-in regional
country-code datasets, and convenient clients for the
WHO Global Health Observatory and
UN Sustainable Development Goals
APIs.
# install.packages("remotes")
remotes::install_github("shanlong-who/DSIR")theme_dsi() — publication-ready ggplot2 theme.
library(DSIR)
library(ggplot2)
ggplot(women, aes(height, weight)) +
geom_point(color = "steelblue") +
theme_dsi()dsi_flextable_defaults() — one-line setup for flextable
formatting (booktabs style, bold headers). Pass
font_family = "Cambria" if you have the font installed.
dsi_flextable_defaults()ggpie() — quick pie charts with automatic percentage labels.
df <- data.frame(category = c("A", "B", "C"), value = c(40, 35, 25))
ggpie(df, "category", "value")wpro_cty — ISO-3 country codes for the WHO Western Pacific
Region.
head(wpro_cty)
#> [1] "AUS" "BRN" "KHM" "CHN" "COK" "FJI"# Search indicators by keyword
gho_indicators("mortality")
# Country-level data for an indicator
gho_data("NCDMORT3070", spatial_type = "country")
# Filter by area and year
gho_data("WHOSIS_000001", area = c("FRA", "DEU"), year_from = 2015)
# Discover available dimensions
gho_dimensions("NCDMORT3070")
gho_dimensions("NCDMORT3070", dimension = "Dim1")# Browse goals, targets, indicators, and geographic areas
sdg_goals()
sdg_targets()
sdg_indicators()
sdg_areas()
# Fetch indicator data
sdg_data("3.2.1", area = "156", year_from = 2015, year_to = 2023)MIT
