forked from kelseyshaw/fecalcanuga
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME.Rmd
More file actions
184 lines (140 loc) · 5.51 KB
/
Copy pathREADME.Rmd
File metadata and controls
184 lines (140 loc) · 5.51 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
---
output: github_document
always_allow_html: true
editor_options:
markdown:
wrap: 72
chunk_output_type: console
---
<!-- 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%",
message = FALSE,
warning = FALSE,
fig.retina = 2,
fig.align = 'center'
)
```
# fecalcanuga
<!-- badges: start -->
[](https://creativecommons.org/licenses/by/4.0/)
[](https://zenodo.org/doi/10.5281/zenodo.20795917)
<!-- badges: end -->
The goal of `fecalcanuga` is to provide data representing 5 months of field work from April - June 2023 in Southern Coastal BC (Canada) and in Kampala (Uganda) from January - February 2024 where household and commercial non-sewered containment data was collected, characterizing demographic, technical, environmental, physical, chemical and biological data for 22 non-sewered sanitation sites in Southern Coastal British Columbia, Canada and 19 sites in Kampala, Uganda.
## Installation
You can install the development version of fecalcanuga from
[GitHub](https://github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("openwashdata/fecalcanuga")
```
```{r}
## Run the following code in console if you don't have the packages
## install.packages(c("dplyr", "knitr", "readr", "stringr", "gt", "kableExtra"))
library(dplyr)
library(knitr)
library(readr)
library(stringr)
library(gt)
library(kableExtra)
```
Alternatively, you can download the individual datasets as a CSV file from the table below.
```{r, echo=FALSE, message=FALSE, warning=FALSE}
extdata_path <- "https://github.com/openwashdata/fecalcanuga/raw/main/inst/extdata/"
read_csv("data-raw/dictionary.csv") |>
distinct(file_name) |>
dplyr::mutate(file_name = str_remove(file_name, ".rda")) |>
dplyr::rename(dataset = file_name) |>
mutate(
CSV = paste0("[Download CSV](", extdata_path, dataset, ".csv)"),
) |>
knitr::kable()
```
## Data
The package provides access to 3 datasets: `containment`, `household_survey`, and `phys_chem_parameter`.
```{r}
library(fecalcanuga)
```
### containment
The dataset `containment` contains data about the technical data (containment size, volume, fecal sludge depth, etc.) for each non-sewered sanitation system containment that was sampled as a part of this field work. It has `r nrow(containment)` observations and `r ncol(containment)` variables
```{r}
containment |>
head(3) |>
gt::gt() |>
gt::as_raw_html()
```
For an overview of the variable names, see the following table.
```{r echo=FALSE, message=FALSE, warning=FALSE}
readr::read_csv("data-raw/dictionary.csv") |>
dplyr::filter(file_name == "containment.rda") |>
dplyr::select(variable_name:description) |>
knitr::kable() |>
kableExtra::kable_styling("striped") |>
kableExtra::scroll_box(height = "200px")
```
### household_survey
The dataset `household_survey` contains data about the collected household / institutional survey data for each location where a non-sewered sanitation containment was sampled. This includes demographic infromation, operational and maintenance information and some technical and environmental parameters.
It has `r nrow(household_survey)` observations and `r ncol(household_survey)` variables
```{r}
household_survey |>
head(3) |>
gt::gt() |>
gt::as_raw_html()
```
For an overview of the variable names, see the following table.
```{r echo=FALSE, message=FALSE, warning=FALSE}
readr::read_csv("data-raw/dictionary.csv") |>
dplyr::filter(file_name == "household_survey.rda") |>
dplyr::select(variable_name:description) |>
knitr::kable() |>
kableExtra::kable_styling("striped") |>
kableExtra::scroll_box(height = "200px")
```
### phys_chem_parameter
The dataset `phys_chem_parameter` contains data about the measured in situ and analyzed in laboratory physical, chemical and biological parameters pertaining to each containment sampled as well as at different veritcal locations in each containment (i.e., Top of containment, middle and bottom).
It has `r nrow(phys_chem_parameter)` observations and `r ncol(phys_chem_parameter)` variables
```{r}
phys_chem_parameter |>
head(3) |>
gt::gt() |>
gt::as_raw_html()
```
For an overview of the variable names, see the following table.
```{r echo=FALSE, message=FALSE, warning=FALSE}
readr::read_csv("data-raw/dictionary.csv") |>
dplyr::filter(file_name == "phys_chem_parameter.rda") |>
dplyr::select(variable_name:description) |>
knitr::kable() |>
kableExtra::kable_styling("striped") |>
kableExtra::scroll_box(height = "200px")
```
## Example
```{r}
# Plot of Volatile Suspended Solids (VSS) versus Chemical Oxygen Demand (COD) for all samples. This plot demonstrates how changes in organic loads (COD) can influence biomass (VSS)
library(fecalcanuga)
library(ggplot2)
# Filter out rows with NA values in COD or vss
filtered_data <- phys_chem_parameter %>%
filter(!is.na(COD) & !is.na(vss))
# Plot VSS vs COD
ggplot(filtered_data, aes(x = vss, y = COD)) +
geom_point() +
geom_smooth(method = "lm", se = FALSE, color = "blue") +
theme_minimal() +
labs(title = "VSS vs COD",
x = "VSS (mg/L)",
y = "COD (mg/L)")
```
## License
Data are available as
[CC-BY](https://github.com/openwashdata/fecalcanuga/blob/main/LICENSE.md).
## Citation
Please cite this package using:
```{r}
citation("fecalcanuga")
```