This repository was archived by the owner on Feb 16, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME.Rmd
More file actions
235 lines (193 loc) · 8.13 KB
/
README.Rmd
File metadata and controls
235 lines (193 loc) · 8.13 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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
---
output: github_document
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# glass.updated
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 `glass.updated` from GitHub:
```{r, eval = FALSE}
# install.packages("devtools")
devtools::install_github("openwashdata/glass.updated")
```
**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 explicitly access it (e.g., with `data("glaas")` or by referencing `glaas` directly). This keeps the package footprint small until you actually need the data.
## Data Structure
The package contains a single dataset: `glaas`
- **Dimensions**: 259,313 rows × 121 variables
- **Coverage**: Multiple GLAAS survey cycles (2013, 2016, 2018, 2021, 2024)
- **Geographic scope**: WHO Member States and territories
- **Thematic areas**: Finance, human resources, monitoring, systems, targets, and more
### Key Variables
The dataset is organized around several core dimensions:
**Geographic Information:**
- `country_code`, `country_name`: ISO codes and country names
- `parent_location_name`: WHO regions (e.g., Eastern Mediterranean Region)
- `region_sdg_name`: SDG regional groupings
- `region_world_bank_name`: World Bank income classifications
**Indicators:**
- `indicator_code`, `indicator_prefix`: Unique indicator identifiers
- `indicator_name`: Full description of WASH indicators
- `grand_parent`, `parent`: Thematic and sub-thematic categorization
**Temporal Information:**
- `time_period`, `data_year`: Survey year
- `survey_round`: GLAAS survey cycle
- `is_comparable_*`: Flags for cross-cycle comparability
**Data Values:**
- `value_code_numeric`: Numeric indicator values
- `value_text`: Categorical or text responses
- `value_amount`: Financial data (where applicable)
- `unit_of_measure`: Units (%, USD, etc.)
**Disaggregation:**
- `dimension1_value`, `dimension2_value`, etc.: Service types (drinking-water, sanitation), settings (urban, rural), and other breakdowns
For a complete description of all 121 variables, see `?glaas` after loading the package.
## Usage Examples
```{r example}
library(glass.updated)
library(tidyverse)
# Load the dataset
data("glaas")
# Plot 1: 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: WHO GLAAS"
) +
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()
)
# Plot 2: 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: WHO GLAAS"
) +
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))
# Plot 3: 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: WHO GLAAS"
) +
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))
# Plot 4: 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: WHO GLAAS"
) +
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/glass.updated/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 both the package and the original GLAAS data source:
**Package citation:**
```
openwashdata (2026). glass.updated: WHO GLAAS Dataset for R.
R package version 0.0.0.9000.
https://github.com/openwashdata/glass.updated
```
**Original data source:**
```
UN-Water Global Analysis and Assessment of Sanitation and Drinking-Water (GLAAS).
World Health Organization. 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.