My project

Description

REASON FOR CHOOSING THE DATA

I chose the data about the composition of solid waste because the issue of solid waste management is a pressing challenge faced by the entire world.

As the global population continues to urbanize and consumption patterns shift, the generation of solid waste is expected to increase and understanding the composition is a crucial first step in handling the issue.

library(tidyverse)
library(dplyr)

Import

readxl::read_excel(path = here::here("data/raw/Dominic.xlsx"))
# A tibble: 217 × 15
   iso3c region_id country_name         income_id gdp     population_populatio…¹
   <chr> <chr>     <chr>                <chr>     <chr>                    <dbl>
 1 ABW   LCN       Aruba                HIC       35563.…                 103187
 2 AFG   SAS       Afghanistan          LIC       2057.0…               34656032
 3 AGO   SSF       Angola               LMC       8036.6…               25096150
 4 ALB   ECS       Albania              UMC       13724.…                2854191
 5 AND   ECS       Andorra              HIC       43711.…                  82431
 6 ARE   MEA       United Arab Emirates HIC       67119.…                9770529
 7 ARG   LCN       Argentina            HIC       23550.…               42981516
 8 ARM   ECS       Armenia              UMC       11019.…                2906220
 9 ASM   EAS       American Samoa       UMC       11113.…                  55599
10 ATG   LCN       Antigua and Barbuda  HIC       17965.…                  96777
# ℹ 207 more rows
# ℹ abbreviated name: ¹​population_population_number_of_people
# ℹ 9 more variables: composition_food_organic_waste_percent <chr>,
#   composition_glass_percent <chr>, composition_metal_percent <chr>,
#   composition_other_percent <chr>, composition_paper_cardboard_percent <chr>,
#   composition_plastic_percent <chr>,
#   composition_rubber_leather_percent <chr>, composition_wood_percent <chr>, …
Dominic <- readxl::read_xlsx(path = "/cloud/project/data/raw/Dominic.xlsx")
dominic_processed_1 <- Dominic |> 
  select(iso3c:composition_plastic_percent) |> 
  rename(region = region_id,
         country = country_name,
         population = population_population_number_of_people,
         food_organic_waste = composition_food_organic_waste_percent,
         glass = composition_glass_percent,
         metal = composition_metal_percent,
         other = composition_other_percent,
         paper_cardboard = composition_paper_cardboard_percent,
         plastic = composition_plastic_percent) |> 
   filter(food_organic_waste != "NA",
         glass != "NA",
         metal != "NA",
         other != "NA",
         paper_cardboard != "NA",
         plastic != "NA")

dominic_processed <- dominic_processed_1 |> 
  mutate(food_organic_waste = as.numeric(food_organic_waste),
         glass = as.numeric(glass),
         metal = as.numeric(metal),
         other = as.numeric(other),
         paper_cardboard = as.numeric(paper_cardboard),
         plastic = as.numeric(plastic))

write_csv(dominic_processed, file = "/cloud/project/data/processed/dominic_processed.csv")