Skip to content

Commit

Permalink
delete non-ASCII characters
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Sampedro committed Mar 12, 2024
1 parent 568f3fc commit 92a0088
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
7 changes: 3 additions & 4 deletions R/m3_health.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ calc_daly_pm25<-function(){
dplyr::mutate(age = dplyr::if_else(age == "All ages", ">25", age)) %>%
tidyr::spread(measure_name, val) %>%
dplyr::rename(country = location_name) %>%
dplyr::mutate(country = dplyr::if_else(country == "Côte d'Ivoire", "Cote d'Ivoire", country)) %>%
gcamdata::left_join_error_no_match(country_iso, by="country") %>%
gcamdata::left_join_error_no_match(rfasst::fasst_reg %>%
dplyr::rename(iso3 = subRegionAlt),
Expand Down Expand Up @@ -84,7 +83,7 @@ calc_daly_o3<-function(){
dplyr::mutate(cause_name = dplyr::if_else(grepl("Chronic obstructive",cause_name), "copd", cause_name)) %>%
tidyr::spread(measure_name, val) %>%
dplyr::rename(country = location_name) %>%
dplyr::mutate(country = dplyr::if_else(country == "Côte d'Ivoire", "Cote d'Ivoire", country)) %>%
#dplyr::mutate(country = dplyr::if_else(country == "Côte d'Ivoire", "Cote d'Ivoire", country)) %>%
gcamdata::left_join_error_no_match(country_iso, by = "country") %>%
gcamdata::left_join_error_no_match(rfasst::fasst_reg %>%
dplyr::rename(iso3 = subRegionAlt),
Expand Down Expand Up @@ -422,7 +421,7 @@ m3_get_yll_pm25<-function(db_path = NULL, query_path = "./inst/extdata", db_name
dplyr::mutate(age = dplyr::if_else(age == "All ages", ">25", age)) %>%
tidyr::spread(measure_name, val) %>%
dplyr::rename(country = location_name) %>%
dplyr::mutate(country = dplyr::if_else(country == "Côte d'Ivoire", "Cote d'Ivoire", country)) %>%
#dplyr::mutate(country = dplyr::if_else(country == "Côte d'Ivoire", "Cote d'Ivoire", country)) %>%
gcamdata::left_join_error_no_match(country_iso, by="country") %>%
gcamdata::left_join_error_no_match(rfasst::fasst_reg %>%
dplyr::rename(iso3 = subRegionAlt),
Expand Down Expand Up @@ -896,7 +895,7 @@ m3_get_yll_o3<-function(db_path = NULL, query_path = "./inst/extdata", db_name =
dplyr::select(location_name = location, measure_name = measure, cause_name = cause, age, val) %>%
tidyr::spread(measure_name, val) %>%
dplyr::rename(country = location_name) %>%
dplyr::mutate(country = dplyr::if_else(country == "Côte d'Ivoire", "Cote d'Ivoire", country)) %>%
#dplyr::mutate(country = dplyr::if_else(country == "Côte d'Ivoire", "Cote d'Ivoire", country)) %>%
gcamdata::left_join_error_no_match(country_iso, by="country") %>%
gcamdata::left_join_error_no_match(rfasst::fasst_reg %>%
dplyr::rename(iso3 = subRegionAlt),
Expand Down
Binary file modified data/raw.daly.rda
Binary file not shown.
Binary file modified data/raw.yll.o3.rda
Binary file not shown.
Binary file modified data/raw.yll.pm25.rda
Binary file not shown.
9 changes: 6 additions & 3 deletions inst/extdata/saveDataFiles.R
Original file line number Diff line number Diff line change
Expand Up @@ -702,17 +702,20 @@ raw.daly = dplyr::bind_rows(
cause %in% c("Diabetes mellitus type 2", "Lower respiratory infections", "Ischemic stroke", "Ischemic heart disease", "Tracheal, bronchus, and lung cancer", "Chronic obstructive pulmonary disease"),
age %in% (c("All ages", "25-29 years", "30-34 years", "35-39 years", "40-44 years", "45-49 years", "50-54 years","55-59 years","60-64 years",
"65-69 years", "70-74 years", "75-79 years", "80-84", "85-89", "90-94", "95+ years"))) %>%
dplyr::mutate(age = gsub(" years", "", age))
dplyr::mutate(age = gsub(" years", "", age)) %>%
dplyr::mutate(location = dplyr::if_else(location == "Côte d'Ivoire", "Cote d'Ivoire", location))

usethis::use_data(raw.daly, overwrite = T)

# raw.yll.pm25
raw.yll.pm25 = read.csv("inst/extdata/IHME-GBD_2019_DATA-f0a8f511-1.csv") %>%
dplyr::filter(rei == "Ambient particulate matter pollution")
dplyr::filter(rei == "Ambient particulate matter pollution") %>%
dplyr::mutate(location = dplyr::if_else(location == "Côte d'Ivoire", "Cote d'Ivoire", location))
usethis::use_data(raw.yll.pm25, overwrite = T)

raw.yll.o3 = read.csv("inst/extdata/IHME-GBD_2019_DATA-f0a8f511-1.csv") %>%
dplyr::filter(rei == "Ambient ozone pollution")
dplyr::filter(rei == "Ambient ozone pollution") %>%
dplyr::mutate(location = dplyr::if_else(location == "Côte d'Ivoire", "Cote d'Ivoire", location))
usethis::use_data(raw.yll.o3, overwrite = T)
#------------------
# New mortality rates
Expand Down

0 comments on commit 92a0088

Please sign in to comment.