-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME.Rmd
More file actions
199 lines (172 loc) · 7.39 KB
/
README.Rmd
File metadata and controls
199 lines (172 loc) · 7.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
---
output: github_document
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%",
dpi = 300,
fig.retina = 2
)
```
# glaas
[](https://creativecommons.org/licenses/by/4.0/)
[](https://zenodo.org/doi/10.5281/zenodo.15497462)
An R data package providing comprehensive access to the UN-Water Global Analysis and Assessment of Sanitation and Drinking-water (GLAAS) dataset. The WHO GLAAS survey collects data on water, sanitation, and hygiene (WASH) systems, policies, and financing from countries worldwide.
While the GLAAS data is available for visualization and download on the [official GLAAS portal](https://glaas.who.int/), this package consolidates the entire dataset in one place, making it easy to perform custom analyses, generate reports, and explore meta-information across survey cycles.
## Installation
You can install `glaas` from GitHub:
```{r, eval = FALSE}
# install.packages("devtools")
devtools::install_github("openwashdata/glaas")
```
> **Note on package size:** Due to the large size of the dataset
> (259,313 rows × 121 variables), this package is not available on CRAN.
> However, the data uses **lazy loading**, which means the dataset is only
> loaded into memory when you actually access it. This keeps the package
> footprint small until you need the data.
## Usage Examples
```{r, message = FALSE}
library(glaas)
library(tidyverse)
```
```{r example, fig.alt = c("Bar chart showing GLAAS survey participation over time from 2013 to 2024", "Stacked bar chart showing participation by World Bank income classification", "Grouped bar chart showing regional representation by UNICEF reporting region", "Line chart showing evolution of GLAAS indicator coverage across thematic areas")}
# Survey participation over time
glaas |>
group_by(time_period) |>
summarise(n_countries = n_distinct(country_name)) |>
ggplot(aes(x = factor(time_period), y = n_countries)) +
geom_col(fill = "#0072B2", alpha = 0.9) +
geom_text(aes(label = n_countries), vjust = -0.5, size = 4, fontface = "bold") +
labs(
title = "GLAAS Survey Participation Over Time",
subtitle = "Number of countries participating in each survey cycle",
x = "",
y = "Number of Countries",
caption = "Source: GLAAS country surveys (WHO/UNICEF)"
) +
theme_minimal(base_size = 12) +
theme(
plot.title = element_text(face = "bold", size = 14),
plot.subtitle = element_text(color = "grey40", size = 11),
panel.grid.major.x = element_blank(),
panel.grid.minor = element_blank()
)
# Participation by World Bank income group
glaas |>
filter(!is.na(region_world_bank_name)) |>
group_by(time_period, region_world_bank_name) |>
summarise(n_countries = n_distinct(country_name), .groups = "drop") |>
mutate(region_world_bank_name = factor(
region_world_bank_name,
levels = c("Low income", "Lower middle income", "Upper middle income", "High income")
)) |>
ggplot(aes(
x = factor(time_period),
y = n_countries,
fill = region_world_bank_name
)) +
geom_col(position = "stack", alpha = 0.9) +
scale_fill_brewer(palette = "Set2", name = "Income Group") +
labs(
title = "GLAAS Participation by World Bank Income Classification",
subtitle = "Distribution of participating countries across income groups",
x = "",
y = "Number of Countries",
caption = "Source: GLAAS country surveys (WHO/UNICEF)"
) +
theme_minimal(base_size = 12) +
theme(
plot.title = element_text(face = "bold", size = 14),
plot.subtitle = element_text(color = "grey40", size = 11),
legend.position = "bottom",
panel.grid.major.x = element_blank(),
panel.grid.minor = element_blank()
) +
guides(fill = guide_legend(nrow = 2))
# Participation by UNICEF region
glaas |>
filter(!is.na(region_unicef_reporting_name)) |>
group_by(time_period, region_unicef_reporting_name) |>
summarise(n_countries = n_distinct(country_name), .groups = "drop") |>
ggplot(aes(
x = factor(time_period),
y = n_countries,
fill = region_unicef_reporting_name
)) +
geom_col(position = "dodge", alpha = 0.85) +
scale_fill_viridis_d(option = "turbo", name = "UNICEF Region") +
labs(
title = "Regional Representation in GLAAS Surveys",
subtitle = "Number of participating countries by UNICEF reporting region",
x = "",
y = "Number of Countries",
caption = "Source: GLAAS country surveys (WHO/UNICEF)"
) +
theme_minimal(base_size = 12) +
theme(
plot.title = element_text(face = "bold", size = 14),
plot.subtitle = element_text(color = "grey40", size = 11),
legend.position = "bottom",
panel.grid.major.x = element_blank(),
panel.grid.minor = element_blank()
) +
guides(fill = guide_legend(nrow = 3, byrow = TRUE))
# Thematic coverage
glaas |>
filter(!is.na(grand_parent_text)) |>
group_by(time_period, grand_parent_text) |>
summarise(n_indicators = n_distinct(indicator_code), .groups = "drop") |>
ggplot(aes(
x = factor(time_period),
y = n_indicators,
group = grand_parent_text,
color = grand_parent_text
)) +
geom_line(linewidth = 1.2, alpha = 0.9) +
geom_point(size = 3, alpha = 0.9) +
scale_color_brewer(palette = "Dark2", name = "Thematic Area") +
labs(
title = "Evolution of GLAAS Indicator Coverage",
subtitle = "Number of indicators tracked per thematic area across survey cycles",
x = "",
y = "Number of Indicators",
caption = "Source: GLAAS country surveys (WHO/UNICEF)"
) +
theme_minimal(base_size = 12) +
theme(
plot.title = element_text(face = "bold", size = 14),
plot.subtitle = element_text(color = "grey40", size = 11),
legend.position = "bottom",
panel.grid.minor = element_blank()
) +
guides(color = guide_legend(nrow = 2))
```
## Contributing
Contributions to improve the package are welcome! Here's how you can help:
1. **Report issues**: If you find bugs or have suggestions, please [open an issue](https://github.com/openwashdata/glaas/issues)
2. **Submit pull requests**: Fork the repository, make your changes, and submit a PR
3. **Improve documentation**: Help expand examples or clarify variable descriptions
4. **Add features**: Suggest or implement helper functions for common analyses
When contributing, please:
- Follow the existing code style
- Update documentation as needed
- Add examples for new functionality
- Ensure the package builds without errors (`devtools::check()`)
## Citation
If you use this package in your research or publications, please cite it as follows:
```
Clavijo Daza A, Massari N, Walder C (2026).
glaas: Complete data from the Global Analysis and Assessment of Sanitation and Drinking-Water (GLAAS).
R package version 0.2.0, https://github.com/openwashdata/glaas.
```
As this package provides access to the GLAAS dataset, please also cite the underlying data:
```
World Health Organization (WHO) & United Nations Children's Fund (UNICEF). (2026).
UN-Water Global Analysis and Assessment of Sanitation and Drinking-Water (GLAAS) Dataset,
2013/2014–2024/2025 cycles [Data set]. GLAAS Data Portal. https://glaas.who.int/
```
## License
The package code is licensed under [CC BY 4.0](LICENSE.md). The GLAAS data is provided by the World Health Organization. Please refer to the [GLAAS data portal](https://glaas.who.int/) for specific terms of data use.