-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
202 lines (154 loc) · 8.17 KB
/
README.Rmd
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
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
library(tidyverse)
library(epoxy)
library(leaflet)
library(cleanteamghana)
```
# cleanteamghana
<!-- badges: start -->
[![DOI](https://zenodo.org/badge/709679841.svg)](https://zenodo.org/doi/10.5281/zenodo.10439886)
[![R-CMD-check](https://github.com/openwashdata/cleanteamghana/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/openwashdata/cleanteamghana/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->
This package contains compiled data utilized in a research paper examining the user experience of the Clean Team Ghana's container-based sanitation service in Kumasi, Ghana.
```{r, echo=FALSE}
library(ggplot2)
annotations <- data.frame(
x = c(round(mean(cleanteamghana$time_to_access_toilet, na.rm = TRUE), 2),
round(median(cleanteamghana$time_to_access_toilet, na.rm = TRUE), 2)),
y = c(165, 175),
label = c("Mean:", "Median:")
)
ggplot(cleanteamghana, aes(time_to_access_toilet)) +
geom_histogram(binwidth = 3, color = "#000000", fill = "#59CF94", boundary = 0, na.rm = TRUE) +
labs(
title = "Time to access toilets before installation of CTG containers",
x = "Time (minutes)",
y = "Count"
) +
theme_classic() +
theme(
plot.title = element_text(color = "#59CF94", size = 16, face = "bold")
) +
scale_x_continuous(breaks = seq(0, 60, by = 10)) +
geom_text(data = annotations, aes(x = x, y = y, label = paste(label, x)), size = 3, fontface = "bold")
```
## Installation
You can install the development version of cleanteamghana from [GitHub](https://github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("openwashdata/cleanteamghana")
```
Alternatively, you can download the individual dataset as a CSV or XLSX
file from the table below.
```{r, echo=FALSE}
library(dplyr)
library(stringr)
library(readr)
extdata_path <- "https://github.com/openwashdata/cleanteamghana/raw/main/inst/extdata/"
read_csv("data-raw/dictionary.csv", col_types = cols(.default = "c")) |>
distinct(file_name) |>
mutate(file_name = str_remove(file_name, ".rda")) |>
rename(dataset = file_name) |>
mutate(
CSV = paste0("[Download CSV](", extdata_path, dataset, ".csv)"),
XLSX = paste0("[Download XLSX](", extdata_path, dataset, ".xlsx)")
) |>
knitr::kable(show_col_types = FALSE)
```
# The research paper
The research paper associated with this data package is named ["Evaluation of user experiences for the Clean Team Ghana container-based sanitation service in Kumasi, Ghana"](https://iwaponline.com/washdev/article/12/3/336/86884/Evaluation-of-user-experiences-for-the-Clean-Team) (Tidwell et al., 2022).
*Tidwell, J. B., Nyarko, K. B., Ross, I., Dwumfour-Asare, B., & Scott, P. (2022). Evaluation of user experiences for the Clean Team Ghana container-based sanitation service in Kumasi, Ghana. Journal of Water, Sanitation and Hygiene for Development, 12(3), 336–346. https://doi.org/10.2166/washdev.2022.013*
It was published in the Journal of Water, Sanitations & Hygiene (WASH) for Development on March 1st, 2022.
## Description
Few affordable and acceptable sanitation solutions exist for densely populated, low-income urban areas. Container-based toilets, considered a safely managed sanitation solution, lack substantial insights into user experiences, essential for governmental considerations. A study was conducted on sanitation quality changes pre- and post-enrollment due to the [Clean Team Ghana (CTG)](https://www.cleanteamtoilets.com/) container-based toilet service in Kumasi, Ghana, spanning June to December 2019. Data was gathered before installation and ten weeks after for 292 customers. Initially, most customers utilized structurally sound public toilets, yet often faced issues like poor hygiene, inadequate handwashing facilities, and an average 14.3-minute usage time. The study revealed that CTG offered a high-quality service, significantly enhancing customers' quality of life, saving costs, narrowing gender disparities, and catering to individuals with physical disabilities. Fewer than 10% of customers reported issues with CTG, such as leakage, filling, odor, or irregular replacements. This evaluation adds weight to the emerging evidence supporting the value users place on container-based sanitation in densely populated urban settings.
## Data
The data set includes household survey responses on sanitation service levels, quality, practices, and observed behaviors. The Sanitation Quality of Life (SanQoL) scores were measured on a 0 (never able) to 3 (always able) scale. Sanitation satisfaction was scored on a scale from 0 to 4, with 0 representing very unsatisfied, 4 representing very satisfied, and 2 being neither satisfied nor unsatisfied.
The package provides access to a single data set.
```{r, echo = TRUE}
library(cleanteamghana)
```
The `cleanteamghana` data set has `r ncol(cleanteamghana)`
variables and `r nrow(cleanteamghana)` observations. For an overview
of the variable names, see the following table.
```{r, eval=FALSE}
cleanteamghana
```
```{r, echo=FALSE}
readr::read_csv("data-raw/dictionary.csv", col_types = cols(.default = "c")) |>
dplyr::filter(file_name == "cleanteamghana.rda") |>
dplyr::select(variable_name:description) |>
knitr::kable()
```
## Examples
### 1) Visualizing Toilet Access Time (Pre-CTG Containers Installation)
This code snippet utilizes ggplot2 to create a histogram illustrating the time taken to access toilets before the implementation of CTG (Clean Team Ghana) containers. The histogram showcases the distribution of time-to-access values, with mean and median annotations indicating central tendency.
```{r}
library(ggplot2)
annotations <- data.frame(
x = c(round(mean(cleanteamghana$time_to_access_toilet, na.rm = TRUE), 2),
round(median(cleanteamghana$time_to_access_toilet, na.rm = TRUE), 2)),
y = c(165, 175),
label = c("Mean:", "Median:")
)
ggplot(cleanteamghana, aes(time_to_access_toilet)) +
geom_histogram(binwidth = 3, color = "#000000", fill = "#59CF94", boundary = 0, na.rm = TRUE) +
labs(
title = "Time to access toilets before installation of CTG containers",
x = "Time (minutes)",
y = "Count"
) +
theme_classic() +
theme(
plot.title = element_text(color = "#59CF94", size = 16, face = "bold")
) +
scale_x_continuous(breaks = seq(0, 60, by = 10)) +
geom_text(data = annotations, aes(x = x, y = y, label = paste(label, x)), size = 3, fontface = "bold")
```
### 2) Customer Sanitation Satisfaction Categories: Mean Scores Comparison
The following code computes the mean satisfaction scores across the various sanitation categories, presenting a comparative analysis through a bar plot.
```{r}
library(dplyr)
library(ggplot2)
# Calculating mean scores for each satisfaction category
satisfaction_means <- cleanteamghana |>
mutate(across(starts_with("satisfaction"), as.integer)) |>
summarise(across(starts_with("satisfaction"), ~mean(., na.rm = TRUE))) |>
rename_with(~gsub("satisfaction_", "", .), starts_with("satisfaction")) |>
rename_with(~gsub("towards_", "", .), starts_with("towards")) |>
rename_with(~gsub("avoiding_", "", .), starts_with("avoiding"))
# Converting the data to a format suitable for plotting
satisfaction_means <- satisfaction_means |>
tidyr::pivot_longer(cols = everything(), names_to = "Satisfaction_Category", values_to = "Mean_Score")
# Creating the bar plot
ggplot(satisfaction_means, aes(x = Satisfaction_Category, y = Mean_Score)) +
geom_bar(stat = "identity", fill = "#59CF94", color = "#000000") +
geom_text(aes(label = round(Mean_Score, 2)), vjust = -0.5, color = "black", size = 3.5) + # Add mean labels on top of bars
labs(
title = "Mean Sanitation Satisfaction Scores",
x = "Satisfaction Category",
y = "Mean Score"
) +
theme_minimal() +
theme(
axis.text.x = element_text(angle = 60, hjust = 1, size = 8)
)+
ylim(0, 4)
```
## License
Data are available as
[CC-BY](https://github.com/openwashdata/cleanteamghana/LICENSE.md).
## Citation
To cite this package, please use:
```{r}
citation("cleanteamghana")
```