-
Notifications
You must be signed in to change notification settings - Fork 1
/
README.Rmd
315 lines (236 loc) · 9.68 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
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
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
---
output: github_document
editor_options:
chunk_output_type: console
markdown:
wrap: 72
---
<!-- 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'
)
library(tidyverse)
library(epoxy)
library(leaflet)
library(durbanplasticwaste)
```
# durbanplasticwaste
<!-- badges: start -->
[![DOI](https://zenodo.org/badge/604573987.svg)](https://zenodo.org/badge/latestdoi/604573987)
[![R-CMD-check](https://github.com/Global-Health-Engineering/durbanplasticwaste/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/Global-Health-Engineering/durbanplasticwaste/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->
This packages combines data collected as part of an MSc. Thesis Project
and an MSc. Semester Project conducted in Durban, South Africa. The
projects were supported by the Global Health Engineering group at ETH
Zurich, Switzerland.
```{r stacked-area-chart-1, echo=FALSE}
plot_stacked_beachwood <- plastic_types |>
filter(place == "Beachwood Mangrove") |>
rename(footwear = shoes) |>
pivot_longer(cols = c(pet:pp, ps:footwear), names_to = "group", values_to = "value") |>
replace_na(list(value = 0)) |>
group_by(date, group) |>
summarise(n = sum(value)) |>
mutate(percentage = n / sum(n)) |>
mutate(date = as_date(date)) |>
ggplot(aes(x = date, y = percentage * 100, fill = group)) +
geom_area(alpha = 0.6 ,linewidth = 0.6, colour = "white") +
scale_y_continuous(expand = c(0, 0, 0.05, 0)) +
scale_x_date(expand = c(0, 0, 0.05, 0)) +
scale_fill_viridis_d(name = "Waste type",
labels = c("Footwear", "Glass", "Other Plastics", "Other Waste",
"PE", "PET", "PP", "PS")) +
labs(title = "Distribution of waste types (in kg)",
subtitle = "Beachwood Mangrove, Durban, South Africa",
x = "Date of sampling in 2022",
y = "Weight (kg)") +
theme_gray() +
theme(panel.grid.minor = element_blank(),
panel.grid.major.x = element_blank(),
axis.line = element_line(),
panel.background = element_rect(fill = "white"),
panel.grid.major = element_line("grey95", linewidth = 0.25),
legend.key = element_rect(fill = NA))
plot_stacked_beachwood
```
# Installation
You can install the development version of durbanplasticwaste from
[GitHub](https://github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("Global-Health-Engineering/durbanplasticwaste")
```
Alternatively, you can download the individual datasets as a CSV or XLSX
file from the table below.
```{r, echo=FALSE}
extdata_path <- "https://github.com/Global-Health-Engineering/durbanplasticwaste/raw/main/inst/extdata/"
read_csv("data-raw/dictionary.csv") |>
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()
```
# Projects
## MSc. Thesis Project
Evaluating the potential of Extended Producer Responsibility returns for
a small local waste collection company through a brand audit of riverine
plastic waste in Durban, South Africa.
### Description
This Master's Thesis Project focuses on determining the growth
opportunities for a small-sized plastic recycling enterprise in light of
the shift from a voluntary to a mandatory Extended Producer
Responsibility (EPR) policy in South Africa.
To achieve this goal in the context of a small start-up in Durban, South
Africa , a brand audit is conducted to identify the top brands that can
be targeted for financing or partnership opportunities. The company,
called [TRI ECO Tours](https://triecotours.co.za/), is a small tourism
and waste collection startup in Durban operated by Siphiwe Rakgabale.
### Research Question
What is the characterization by type, application, and brand of plastic
waste collected in the uMngeni River system in Durban, South Africa?
### Data
The data was collected throughout two months in Durban, South Africa
right before the rainy season. The collection took place in 6 different
litterboom locations throughout Durban. The data gathered was the audit
of the occurence of the brands washed into the litterbooms.
The package provides access to three data sets.
```{r}
library(durbanplasticwaste)
```
```{epoxy}
The `litterboom_counts` data set has {ncol(litterboom_counts)} variables and {nrow(litterboom_counts)} observations. For an overview of the variable names, see the following table.
```
```{r, eval=FALSE}
litterboom_counts
```
```{r, echo=FALSE}
readr::read_csv("data-raw/dictionary.csv") |>
dplyr::filter(file_name == "litterboom_counts.rda") |>
dplyr::select(variable_name:description) |>
knitr::kable()
```
```{epoxy}
The `litterboom_weights` data set has {ncol(litterboom_weights)} variables and {nrow(litterboom_weights)} observations. For an overview of the variable names, see the following table.
```
```{r, echo=FALSE}
readr::read_csv("data-raw/dictionary.csv") |>
dplyr::filter(file_name == "litterboom_weights.rda") |>
dplyr::select(variable_name:description) |>
knitr::kable()
```
```{epoxy}
The `locations` data set has {ncol(locations)} variables and {nrow(locations)} observations. For an overview of the variable names, see the following table.
```
```{r, echo=FALSE}
readr::read_csv("data-raw/dictionary.csv") |>
dplyr::filter(file_name == "locations.rda") |>
dplyr::select(variable_name:description) |>
knitr::kable()
```
Locations data as a map illustrating the six litterboom sampling
locations in Durban, South Africa. For an interactive map and other code
examples, see `vignette("examples")`.
```{r, echo=FALSE}
sampling_locations <- leaflet(locations) |>
setView(lng = locations$longitude[[4]],
lat = locations$latitude[[4]],
zoom = 13) |>
addTiles() |>
addCircleMarkers(
lng = ~longitude,
lat = ~latitude,
label = ~location,
radius = 10,
stroke = FALSE,
fillOpacity = 1,
labelOptions = labelOptions(noHide = T,
textsize = "10px",
direction = "left",
offset = c(0, 0),
style = list(
"box-shadow" = "3px 3px rgba(0,0,0,0.25)",
"border-color" = "rgba(0,0,0,0.5)",
"font-style" = "italic"
)))
sampling_locations |>
mapview::mapshot(file = here::here("man/figures/map-litterboom-sampling-locations.png"))
knitr::include_graphics("man/figures/map-litterboom-sampling-locations.png")
```
## MSc. Semester Project
Examination of non-recycled marine plastic litter in order to identify
recycling and beneficiation pathways in Durban, South Africa
### Description
This Semester Thesis Project focuses on determining the distribution of
plastic litter on the Durban beachfront in order to identify key targets
for policy and financial support through the South African EPR policy to
reduce plastic spills into the environment and promote higher recycling
rates.
Research Question
What types and amounts of plastic are found along the beachfront in the
mangroves of Durban-North, South Africa?
### Data
The data was collected in collaboration with a local team that provided
the waste for the study. Two different approaches were used to clean up
the waste. One to collect the waste floating on the river, preventing it
from reaching the sea and one to collect waste washed ashore at the
beaches. Three locations along the rivers close to settlements and one
at the beach in Durban North.
The package provides access to one data set of this project.
```{r}
library(durbanplasticwaste)
```
```{epoxy}
The `plastic_types` data set has {ncol(plastic_types)} variables and {nrow(plastic_types)} observations. {nrow(filter(plastic_types, beach & place != "Beach Total"))} observations were made on the beach which were added together in the row that has "Beach Total" as the value for the variable "place". One observation was done at a litterboom. For an overview of the variable names, see the following table.
```
```{r, eval=FALSE}
plastic_types
```
```{r, echo=FALSE}
readr::read_csv("data-raw/dictionary.csv") |>
dplyr::filter(file_name == "plastic_types.rda") |>
dplyr::select(variable_name:description) |>
knitr::kable()
```
The following plot is showing the distribution of the waste weight for different plastic and waste types at the Beachwood Mangrove across the sampling period (September 19th 2022 - October 17th 2022) in percent.
```{r stacked-area-chart-2, echo=FALSE}
plot_stacked_beachwood
```
## Examples
```{epoxy}
The `litterboom_counts` data identifies {length(unique(litterboom_counts$group))} unique groups that own the identified brands. The top 10 brands are shown in the following table. All other brands are lumped together as OTHER.
```
```{r}
library(durbanplasticwaste)
library(dplyr)
library(forcats)
litterboom_counts |>
mutate(group = factor(group)) |>
mutate(group = fct_lump(group, n = 10, other_level = "OTHER")) |>
group_by(group) |>
summarise(
count = sum(count)
) |>
arrange(desc(count)) |>
mutate(percent = count / sum(count) * 100) |>
knitr::kable(digits = 0)
```
## License
Data are available as
[CC-BY](https://github.com/Global-Health-Engineering/durbanplasticwaste/blob/main/LICENSE.md).
## Citation
To cite this package, please use:
```{r}
citation("durbanplasticwaste")
```