library(tidyverse)
library(patchwork)
library(skimr)
library(knitr)
## Rows: 225 Columns: 6
## -- Column specification --------------------------------------------------------
## Delimiter: ","
## chr (1): waste_type
## dbl (5): waste_disposed_of_tonne, total_waste_recycled_tonne, total_waste_ge...
##
## i Use `spec()` to retrieve the full column specification for this data.
## i Specify the column types or set `show_col_types = FALSE` to quiet this message.
glimpse(waste_data)
## Rows: 225
## Columns: 6
## $ waste_type <chr> "Food", "Paper/Cardboard", "Plastics", "C&~
## $ waste_disposed_of_tonne <dbl> 679900, 576000, 762700, 9700, 111500, 1191~
## $ total_waste_recycled_tonne <dbl> 111100, 607100, 59500, 1585700, 209000, 41~
## $ total_waste_generated_tonne <dbl> 791000, 1183100, 822200, 1595400, 320500, ~
## $ recycling_rate <dbl> 0.14, 0.51, 0.07, 0.99, 0.65, 0.78, 0.99, ~
## $ year <dbl> 2016, 2016, 2016, 2016, 2016, 2016, 2016, ~
sort(unique(waste_data$waste_type))
## [1] "Ash & Sludge"
## [2] "Ash and sludge"
## [3] "C&D"
## [4] "Construction debris"
## [5] "Construction Debris"
## [6] "Ferrous metal"
## [7] "Ferrous Metal"
## [8] "Ferrous Metals"
## [9] "Food"
## [10] "Food waste"
## [11] "Glass"
## [12] "Horticultural waste"
## [13] "Horticultural Waste"
## [14] "Non-ferrous metal"
## [15] "Non-ferrous metals"
## [16] "Non-ferrous Metals"
## [17] "Others"
## [18] "Others (stones, ceramic, rubber, etc.)"
## [19] "Others (stones, ceramics & rubber etc)"
## [20] "Others (stones, ceramics & rubber etc.)"
## [21] "Paper/Cardboard"
## [22] "Plastic"
## [23] "Plastics"
## [24] "Scrap tyres"
## [25] "Scrap Tyres"
## [26] "Sludge"
## [27] "Textile/Leather"
## [28] "Total"
## [29] "Used slag"
## [30] "Used Slag"
## [31] "Wood"
## [32] "Wood/Timber"
clean_waste_data <- waste_data %>%
filter(waste_type != "Total") %>%
mutate(waste_type = recode(waste_type,
"Others (stones, ceramic, rubber, etc.)" = "Others",
"Others (stones, ceramics & rubber etc.)" = "Others",
"Others (stones, ceramics & rubber etc)"= "Others",
"(stones, ceramic, rubber, etc.)" = "Others",
"Plastic" = "Plastics",
"Food" = "Food waste" ,
"Ash and sludge" = "Ash & Sludge" ,
"Construction debris" = "Construction Debris",
"C&D"= "Construction Debris",
"Ferrous metal" = "Ferrous Metal",
"Ferrous Metals" = "Ferrous Metal",
"Horticultural waste" = "Horticultural Waste" ,
"Non-ferrous metal" = "Non-ferrous Metals",
"Non-ferrous metals" = "Non-ferrous Metals",
"Scrap tyres" = "Scrap Tyres",
"Used slag"= "Ash & Sludge",
"Sludge" = "Ash & Sludge",
"Sludge" = "Ash & Sludge",
"Wood" = "Wood/Timber"
))
unique(clean_waste_data$waste_type)
## [1] "Food waste" "Paper/Cardboard" "Plastics"
## [4] "Construction Debris" "Horticultural Waste" "Wood/Timber"
## [7] "Ferrous Metal" "Non-ferrous Metals" "Ash & Sludge"
## [10] "Glass" "Textile/Leather" "Scrap Tyres"
## [13] "Others" "Used Slag"
clean_waste_data <- clean_waste_data %>%
mutate(year = as.factor(year))
write_csv(clean_waste_data,"clean_data2003-2007.csv")
generated <- clean_waste_data %>%
group_by(year) %>%
summarise(total = sum(total_waste_generated_tonne))
generated <- tibble(generated,type = rep("generated", 15))
disposed <- clean_waste_data %>%
group_by(year) %>%
summarise(total = sum(waste_disposed_of_tonne))
disposed <- tibble(disposed, type = rep("disposed", 15))
recycle <- clean_waste_data %>%
group_by(year) %>%
summarise(total = sum(total_waste_recycled_tonne))
recycle <- tibble(recycle, type = rep("recycle", 15))
all_over <- bind_rows(generated, disposed, recycle)
all_over <- all_over %>%
group_by(type, year) %>%
summarise(total = sum(total))
## `summarise()` has grouped output by 'type'. You can override using the `.groups` argument.
all_over
## # A tibble: 45 x 3
## # Groups: type [3]
## type year total
## <chr> <fct> <dbl>
## 1 disposed 2003 2505000
## 2 disposed 2004 2482600
## 3 disposed 2005 2548800
## 4 disposed 2006 2563600
## 5 disposed 2007 2566000
## 6 disposed 2008 2627600
## 7 disposed 2009 2628900
## 8 disposed 2010 2759500
## 9 disposed 2011 2859500
## 10 disposed 2012 2933900
## # ... with 35 more rows
options(scipen = 999)
all_over %>%
ggplot(aes(year, weight = total, fill = type))+
geom_bar(position = "dodge")+
labs(
title = "Total Generated,Disposed, Recycle, Waste from 2003 to 2007",
y = "Waste tonnes"
)
The graph above show how each year generated, disposed, recycle from year 2003 to 2017 on the below we will analyze each one of it. we will see the structure of each column provided and we will look some in site that we can found on provided data.
clean_waste_data %>%
ggplot(aes(total_waste_generated_tonne)) +
geom_histogram(aes(y = ..density..),bins= 10, fill = "blue", alpha = .6 )+
geom_density(fill = "skyblue", alpha = .5, color = "skyblue")+
labs(
title = "Waste Generated(Tonnes) Distribution",
subtitle = "The Distribution is skewed to the right meaning\nthat our some values more occur on the left side of the Graph\n or we can say that the Generate Waste is Almost beetween 0 - 480,000 tonnes "
)+
theme(plot.title = element_text(size = 18,
hjust = .5,
face = "bold"),
plot.subtitle = element_text(size = 10))
total_waste_generated <- clean_waste_data %>%
group_by(waste_type) %>%
summarise(total_waste_generated = sum(total_waste_generated_tonne)) %>%
arrange(-total_waste_generated)
total_waste_generated
## # A tibble: 14 x 2
## waste_type total_waste_generated
## <chr> <dbl>
## 1 Paper/Cardboard 18120800
## 2 Ferrous Metal 16280900
## 3 Construction Debris 15918300
## 4 Plastics 11067700
## 5 Food waste 9876400
## 6 Wood/Timber 4615500
## 7 Used Slag 4342100
## 8 Others 4256200
## 9 Horticultural Waste 3933400
## 10 Ash & Sludge 3428700
## 11 Textile/Leather 1884000
## 12 Non-ferrous Metals 1541500
## 13 Glass 1059600
## 14 Scrap Tyres 359300
options(scipen = 999)
total_waste_generated %>%
mutate(waste_type = reorder(waste_type, total_waste_generated)) %>%
ggplot(aes(x = waste_type, weight = total_waste_generated,fill = waste_type ))+
geom_bar(show.legend = F)+
theme_bw()+
coord_flip()+
labs(
title = "Total waste Generated per Waste Type from 2003-2017",
subtitle = "As We can See in the Graph the Paper/Cardboard\nhave a higher Generated Waste with a 18,120,800 tonnes",
x = "Type of Waste",
y = "Tonnes of Waste"
)+
theme(plot.title = element_text(size = 18,
hjust = 2,
face = "bold"),
plot.subtitle = element_text(size = 13))
year_generated <- clean_waste_data %>%
group_by(year) %>%
summarise(total_tonnes = sum(total_waste_generated_tonne))
year_generated
## # A tibble: 15 x 2
## year total_tonnes
## <fct> <dbl>
## 1 2003 4728200
## 2 2004 4789700
## 3 2005 5018200
## 4 2006 5220500
## 5 2007 5600800
## 6 2008 5970200
## 7 2009 6114100
## 8 2010 6517000
## 9 2011 6898300
## 10 2012 7269500
## 11 2013 7851500
## 12 2014 7514400
## 13 2015 7673500
## 14 2016 7814200
## 15 2017 7704300
year_generated %>%
mutate(year = as.numeric(as.character(year))) %>%
ggplot(aes(year, total_tonnes))+
geom_line(size = 1, color = "darkgreen")+
geom_point(color = "darkgreen")+
theme_bw()+
labs(
title = "Total Changes of waste Generated per Year from 2003-2017",
subtitle = "There's a increase of Waste Generated all over\nthe year 2003 to 2017 ",
y = "waste Tonnes"
)+
theme(plot.title = element_text(size = 15,
hjust = .05,
face = "bold"),
plot.subtitle = element_text(size = 10))
total_waste_generated_year <- clean_waste_data %>%
group_by(waste_type, year) %>%
summarise(total_waste_generated = sum(total_waste_generated_tonne)) %>%
arrange(year)
## `summarise()` has grouped output by 'waste_type'. You can override using the `.groups` argument.
total_waste_generated_year
## # A tibble: 206 x 3
## # Groups: waste_type [14]
## waste_type year total_waste_generated
## <chr> <fct> <dbl>
## 1 Ash & Sludge 2003 88500
## 2 Construction Debris 2003 422900
## 3 Ferrous Metal 2003 856700
## 4 Food waste 2003 548000
## 5 Glass 2003 65500
## 6 Horticultural Waste 2003 304600
## 7 Non-ferrous Metals 2003 93900
## 8 Others 2003 103800
## 9 Paper/Cardboard 2003 1084700
## 10 Plastics 2003 579900
## # ... with 196 more rows
total_waste_generated_year %>%
ggplot(aes(x = year, weight = total_waste_generated, fill = waste_type))+
geom_bar()+
labs(
title= "Total waste Disposed of tonnes per Waste Type per Year (2003-2017)",
subtitle = "All over the year from 2003 - 2017 based on Legend\nwe see on right side of graph the Construction Debris, Ferous Metal and\nPapers/Carboards have a higher number of tonnes Waste Generated",
y = "waste Tonnes"
)+
theme(plot.title = element_text(size = 15,
hjust = .05,
face = "bold"),
plot.subtitle = element_text(size = 10))
total_waste_generated_year_change <- total_waste_generated_year %>%
mutate(year = as.numeric(as.character(year))) %>%
group_by(waste_type, year) %>%
summarise(total_waste_tonnes = sum(total_waste_generated)) %>%
arrange(year)
## `summarise()` has grouped output by 'waste_type'. You can override using the `.groups` argument.
total_waste_generated_year_change
## # A tibble: 206 x 3
## # Groups: waste_type [14]
## waste_type year total_waste_tonnes
## <chr> <dbl> <dbl>
## 1 Ash & Sludge 2003 88500
## 2 Construction Debris 2003 422900
## 3 Ferrous Metal 2003 856700
## 4 Food waste 2003 548000
## 5 Glass 2003 65500
## 6 Horticultural Waste 2003 304600
## 7 Non-ferrous Metals 2003 93900
## 8 Others 2003 103800
## 9 Paper/Cardboard 2003 1084700
## 10 Plastics 2003 579900
## # ... with 196 more rows
total_waste_generated_year_change %>%
mutate(year = as.numeric(as.character(year))) %>%
ggplot(aes(year, total_waste_tonnes, colour = waste_type))+
geom_line(size = 1, )+
geom_point()+
theme_bw()+
labs(
title = "Total Changes of waste Generated per Waste Type per Year from 2003-2017",
subtitle = "There's a increase of Waste Generated all over the year 2003 to 2017 but also some waste type\nis flatten or no changes happen to them.",
y = "waste Tonnes"
)+
theme(plot.title = element_text(size = 15,
hjust = .05,
face = "bold"),
plot.subtitle = element_text(size = 12),
legend.position = "bottom",
legend.text = element_text(size = 10))
clean_waste_data %>%
ggplot(aes(waste_disposed_of_tonne)) +
geom_histogram(aes(y = ..density..),bins= 10, fill = "blue", alpha = .6 )+
geom_density(fill = "skyblue", alpha = .5, color = "skyblue")+
labs(
title = "Waste Disposed(Tonnes) Distribution",
subtitle = "The Distribution is skewed to the right meaning\nthat our some values more occur on the left side of the Graph\n or we can say that the Generate Waste is Almost beetween 0 - 200,000 tonnes "
)+
theme(plot.title = element_text(size = 18,
hjust = .5,
face = "bold"),
plot.subtitle = element_text(size = 10))
waste_disposed <- clean_waste_data %>%
group_by(waste_type) %>%
summarise(Total_waste_disposed = sum(waste_disposed_of_tonne)) %>%
arrange(-Total_waste_disposed)
waste_disposed
## # A tibble: 14 x 2
## waste_type Total_waste_disposed
## <chr> <dbl>
## 1 Plastics 10016800
## 2 Paper/Cardboard 8915500
## 3 Food waste 8728500
## 4 Others 4155200
## 5 Ash & Sludge 2067300
## 6 Horticultural Waste 1970600
## 7 Textile/Leather 1724000
## 8 Wood/Timber 1621300
## 9 Glass 874800
## 10 Ferrous Metal 772100
## 11 Construction Debris 252000
## 12 Non-ferrous Metals 223000
## 13 Used Slag 211400
## 14 Scrap Tyres 60900
waste_disposed %>%
mutate(waste_type = reorder(waste_type, Total_waste_disposed)) %>%
ggplot(aes(x = waste_type, weight = Total_waste_disposed, fill = waste_type))+
geom_bar(show.legend = F)+
theme_bw()+
coord_flip()+
labs(
title = "Total waste Disposed per Waste Type from 2003-2017",
subtitle = "As We can See in the Graph the Plastics\nhave a higher Generated Waste with a 10,016,800 tonnes",
x = "Type of Waste",
y = "Tonnes of Waste"
)+
theme(plot.title = element_text(size = 18,
hjust = 2,
face = "bold"),
plot.subtitle = element_text(size = 13))
year_disposed <- clean_waste_data %>%
group_by(year) %>%
summarise(total_tonnes = sum(waste_disposed_of_tonne))
year_disposed
## # A tibble: 15 x 2
## year total_tonnes
## <fct> <dbl>
## 1 2003 2505000
## 2 2004 2482600
## 3 2005 2548800
## 4 2006 2563600
## 5 2007 2566000
## 6 2008 2627600
## 7 2009 2628900
## 8 2010 2759500
## 9 2011 2859500
## 10 2012 2933900
## 11 2013 3025600
## 12 2014 3043400
## 13 2015 3023800
## 14 2016 3045200
## 15 2017 2980000
year_disposed %>%
mutate(year = as.numeric(as.character(year))) %>%
ggplot(aes(year, total_tonnes))+
geom_line(size = 1, color = "orange")+
geom_point(size = 2, color = "orange")+
theme_bw()+
labs(
title = "Total Changes of waste Disposed per Year from 2003-2017",
subtitle = "There's a increase of Waste Disposed all over the year 2003 to 2017 ",
y = "waste Tonnes"
)+
theme(plot.title = element_text(size = 15,
hjust = .05,
face = "bold"),
plot.subtitle = element_text(size = 10))
total_waste_disposed_year <- clean_waste_data %>%
group_by(waste_type, year) %>%
summarise(total_waste_disposed = sum(waste_disposed_of_tonne)) %>%
arrange(-total_waste_disposed)
## `summarise()` has grouped output by 'waste_type'. You can override using the `.groups` argument.
total_waste_disposed_year
## # A tibble: 206 x 3
## # Groups: waste_type [14]
## waste_type year total_waste_disposed
## <chr> <fct> <dbl>
## 1 Plastics 2014 789000
## 2 Plastics 2015 766800
## 3 Plastics 2017 763400
## 4 Plastics 2016 762700
## 5 Plastics 2013 741100
## 6 Plastics 2012 721300
## 7 Food waste 2013 696000
## 8 Food waste 2014 687200
## 9 Food waste 2015 681400
## 10 Food waste 2016 679900
## # ... with 196 more rows
total_waste_disposed_year %>%
ggplot(aes(x = year, weight = total_waste_disposed, fill = waste_type))+
geom_bar()+
labs(
title= "Total waste Generated of tonnes per Waste Type per Year (2003-2017)",
subtitle = "All over the year from 2003 - 2017 based on Legend we see on right side of graphthe Food Waste,\nPaper/Carboardand Plasticshave a higher number of tonnes Waste Disposed",
y = "waste Tonnes"
)+
theme(plot.title = element_text(size = 15,
hjust = .05,
face = "bold"),
plot.subtitle = element_text(size = 10))
options(scipen = 999)
total_waste_disposed_year %>%
mutate(year = as.numeric(as.character(year))) %>%
ggplot(aes(year, total_waste_disposed, colour = waste_type))+
geom_line()+
geom_point()+
theme_minimal()+
labs(
title = "Total Changes of waste Disposed per Year from 2003-2017",
subtitle = "Like waste Generated the Waste Disposal have a increase all over the year\nalso, some waste type have no changes happen",
y = "waste Tonnes"
)+
theme(plot.title = element_text(size = 15,
hjust = .05,
face = "bold"),
plot.subtitle = element_text(size = 10))
clean_waste_data %>%
ggplot(aes(total_waste_recycled_tonne)) +
geom_histogram(aes(y = ..density..),bins= 10, fill = "blue", alpha = .6 )+
geom_density(fill = "skyblue", alpha = .5, color = "skyblue")+
labs(
title = "Waste Recycle(Tonnes) Distribution",
subtitle = "The Distribution is skewed to the right meaning\nthat our some values more occur on the left side of the Graph\n or we can say that the Generate Waste is Almost beetween 0 - 500,000 tonnes "
)+
theme(plot.title = element_text(size = 18,
hjust = .5,
face = "bold"),
plot.subtitle = element_text(size = 10))
waste_recycled <- clean_waste_data %>%
group_by(waste_type) %>%
summarise(total_waste_recycled = sum(total_waste_recycled_tonne)) %>%
arrange(-total_waste_recycled)
waste_recycled
## # A tibble: 14 x 2
## waste_type total_waste_recycled
## <chr> <dbl>
## 1 Construction Debris 15666300
## 2 Ferrous Metal 15508800
## 3 Paper/Cardboard 9205200
## 4 Used Slag 4130700
## 5 Wood/Timber 2994200
## 6 Horticultural Waste 1962800
## 7 Ash & Sludge 1361400
## 8 Non-ferrous Metals 1318500
## 9 Food waste 1147900
## 10 Plastics 1050900
## 11 Scrap Tyres 298400
## 12 Glass 184800
## 13 Textile/Leather 160000
## 14 Others 101200
waste_recycled %>%
mutate(waste_type = reorder(waste_type, total_waste_recycled)) %>%
ggplot(aes(waste_type, weight = total_waste_recycled, fill = waste_type))+
coord_flip()+
geom_bar()+
labs(
title = "Total waste Recycle per waste type(2003-2017",
subtitle = "The graph represent that Ferrous Metal and Construction Debris Have almost same value\nof aproximetly 15m tonnes recycled ",
x = "Waste Type",
y = "waste Tonnes"
)+
theme(
plot.title = element_text(size = 18,
hjust = .5,
face = "bold"
),
plot.subtitle = element_text(size = 12)
)
year_recycled <- clean_waste_data %>%
group_by(year) %>%
summarise(total_tonnes = sum(total_waste_recycled_tonne))
year_recycled
## # A tibble: 15 x 2
## year total_tonnes
## <fct> <dbl>
## 1 2003 2223200
## 2 2004 2307100
## 3 2005 2469400
## 4 2006 2656900
## 5 2007 3034800
## 6 2008 3342600
## 7 2009 3485200
## 8 2010 3757500
## 9 2011 4038800
## 10 2012 4335600
## 11 2013 4825900
## 12 2014 4471100
## 13 2015 4649700
## 14 2016 4769000
## 15 2017 4724300
year_recycled %>%
mutate(year = as.numeric(as.character(year))) %>%
ggplot(aes(year, total_tonnes))+
geom_line(size = 1, color = "brown")+
geom_point(color = "brown")+
theme_bw()+
labs(
title = "Total Changes of waste Recycled per Year from 2003-2017",
subtitle = "There's a increase of Waste Recycled all over the year 2003 to 2017 ",
y = "waste Tonnes"
)+
theme(plot.title = element_text(size = 15,
hjust = .05,
face = "bold"),
plot.subtitle = element_text(size = 10))
total_waste_recycled_year <- clean_waste_data %>%
group_by(waste_type, year) %>%
summarise(total_waste_recycled = sum(total_waste_recycled_tonne)) %>%
arrange(year)
## `summarise()` has grouped output by 'waste_type'. You can override using the `.groups` argument.
total_waste_recycled_year
## # A tibble: 206 x 3
## # Groups: waste_type [14]
## waste_type year total_waste_recycled
## <chr> <fct> <dbl>
## 1 Ash & Sludge 2003 0
## 2 Construction Debris 2003 398300
## 3 Ferrous Metal 2003 799000
## 4 Food waste 2003 32900
## 5 Glass 2003 6200
## 6 Horticultural Waste 2003 119300
## 7 Non-ferrous Metals 2003 75800
## 8 Others 2003 0
## 9 Paper/Cardboard 2003 466200
## 10 Plastics 2003 39100
## # ... with 196 more rows
total_waste_recycled_year %>%
ggplot(aes(x = year, weight = total_waste_recycled, fill = waste_type))+
geom_bar()+
labs(
title= "Total waste Generated of tonnes per Waste Type per Year (2003-2017)",
subtitle = "All over the year from 2003 - 2017 based on Legend we see on right side of graph the Construction and Ferrous Metal have a higher number of tonnes Waste recycle",
y = "waste Tonnes"
)+
theme(plot.title = element_text(size = 15,
hjust = .05,
face = "bold"),
plot.subtitle = element_text(size = 10))
options(scipen = 999)
total_waste_recycled_year %>%
mutate(year = as.numeric(as.character(year))) %>%
ggplot(aes(year, total_waste_recycled, colour = waste_type))+
geom_line()+
geom_point()+
theme_minimal()+
labs(
title = "Total Changes of waste Disposed per Year from 2003-2017",
subtitle = "Like other graph the Waste recycled have a increase all over the year\nalso, some waste type have no changes happen",
y = "waste Tonnes"
)+
theme(plot.title = element_text(size = 15,
hjust = .05,
face = "bold"),
plot.subtitle = element_text(size = 10))