Commit c8650448 authored by Renaud Lancelot's avatar Renaud Lancelot 🌍
Browse files

Changes in plan to updtate the West and Central Africa analysis

parent 792fff62
Pipeline #14858 failed with stage
in 24 seconds
......@@ -40,152 +40,174 @@ plan <- drake_plan(
"Georgia", "Israel", "Jordan", "Lebanon", "Libya",
"Moldova", "Morocco", "Syria", "Tunisia", "Ukraine"),
wcAfrica = c("Cameroon", "Central African Republic", "Chad",
"Congo DR", "Congo", "Equatorial Guinea", "Gabon",
"Sao Tome and Principe", "Benin", "Burkina Faso",
"Cape Verde", "The Gambia", "Ghana", "Guinea",
"Guinea Bissau", "Cote d'Ivoire", "Liberia", "Mali",
"Mauritania", "Niger", "Nigeria", "Senegal",
"Sierra Leone", "Togo"),
## Total population counts and densities by Country, Year and Sex.
## Source: United Nations'[World Population Prospects
## 2019](https://population.un.org/wpp/)
## https://population.un.org/wpp/Download/Standard/CSV/
world_population = read.table(
file_in("https://population.un.org/wpp/Download/Files/1_Indicators%20(Standard)/CSV_FILES/WPP2019_TotalPopulationBySex.csv"),
header = T,
sep = ",",
as.is = T,
check.names = F,
quote = "\""
),
## ECDC Covid19 geographic distribution data
last_day = Sys.Date() - 1,
## string for today
sdt = format(Sys.Date(),
"%d %b %Y"),
covid = ecdc_covid19(Sys.Date() - 1),
## ## String notice for data update
## data_update_date = format(Sys.Date() - 1,
## "%d %b %Y"),
## Lock-down dates
lockdown_dates = read_excel(file_in("data/lockdown.xlsx")) %>%
transmute(
name = standardise_country_names(raster::trim(name)),
lockdown = as.Date(lockdown)
file_in("https://population.un.org/wpp/Download/Files/1_Indicators%20(Standard)/CSV_FILES/WPP2019_TotalPopulationBySex.csv"),
header = T,
sep = ",",
as.is = T,
check.names = F,
quote = "\""
),
## GIS vector layer for European countries (EU 27 + UK + EFTA +
## candidate countries + non-EU countries). Source GADM.org
## version 3.6
geo_europe_light = readOGR(dsn = "data/geo_europe_light.gpkg",
layer = "geo_europe_light"),
## GIS vector layer for the region of interest covering European
## countries described above
roi_europe_light = readOGR(dsn = "data/roi_europe_light.gpkg",
layer = "roi_europe_light"),
## geo_europe = readOGR(dsn = file_in("data/geo_europe.gpkg"),
## layer = "geo_europe"),
## GIS vector layer for the region of interest covering European
## countries described above
## roi_europe = readOGR(dsn = file_in("data/roi_europe.gpkg"),
## layer = "roi_europe"),
## DERIVED DATA ----------------------------------------
## ## Deaths by country and date
## deaths_by_ctry_dt =
## covid %>%
## group_by(date, name) %>%
## summarise(deaths = sum(deaths)) %>%
## ungroup() %>%
## mutate(date = as.Date(date)),
## Population counts in thousands of people
pop_countries_2019 = pop_countries(world_population, year = 2019),
## ## today (ANSI)
## tod = format(Sys.Date(), "%Y%m%d"),
## Coordinate Reference Systems
wgs84 = CRS("+proj=longlat +ellps=WGS84",
doCheckCRSArgs = FALSE),
merc = CRS("+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs",
doCheckCRSArgs = FALSE),
eust = "MOOD has received funding from the EU Horizon 2020 Research and Innovation programme under grant agreement No 874850.",
report_euro_html =
rmarkdown::render(
knitr_in("src/Covid19MortalityEurope.Rmd"),
# knit_root_dir = "../public", # Is this necessary or convenient?
output_dir = "public", # https://github.com/ropensci/drake/issues/742
output_format =
rmdformats::readthedown(
dev = "png",
toc_depth = 3,
lightbox = T,
gallery = T,
use_bookdown = T,
number_sections = T),
output_file =
file_out("public/covid19MortalityEurope.html"),
quiet = FALSE
),
report_euro_pdf =
rmarkdown::render(
knitr_in("src/Covid19MortalityEurope.Rmd"),
## ECDC Covid19 geographic distribution data
last_day = Sys.Date() - 1,
## string for today
sdt = format(Sys.Date(),
"%d %b %Y"),
covid = ecdc_covid19(Sys.Date() - 1),
## ## String notice for data update
## data_update_date = format(Sys.Date() - 1,
## "%d %b %Y"),
## Lock-down dates
lockdown_dates = read_excel(file_in("data/lockdown.xlsx")) %>%
transmute(
name = standardise_country_names(raster::trim(name)),
lockdown = as.Date(lockdown)
),
## GIS vector layer for European countries (EU 27 + UK + EFTA +
## candidate countries + non-EU countries). Source GADM.org
## version 3.6
geo_europe_light = readOGR(dsn = "data/geo_europe_light.gpkg",
layer = "geo_europe_light"),
## GIS vector layer for the region of interest covering European
## countries described above
roi_europe_light = readOGR(dsn = "data/roi_europe_light.gpkg",
layer = "roi_europe_light"),
## GIS vector layer for West and Central African countries
geoWCAfrica = readOGR(dsn = "data/geoWCAfricaLight.gpkg",
layer = "geoWCAfricaLight"),
roiWCAfrica = readOGR(dsn = "data/roiWCAfricaLight.gpkg",
layer = "roiWCAfricaLight"),
## DERIVED DATA ----------------------------------------
## ## Deaths by country and date
## deaths_by_ctry_dt =
## covid %>%
## group_by(date, name) %>%
## summarise(deaths = sum(deaths)) %>%
## ungroup() %>%
## mutate(date = as.Date(date)),
## Population counts in thousands of people
pop_countries_2019 = pop_countries(world_population, year = 2019),
## ## today (ANSI)
## tod = format(Sys.Date(), "%Y%m%d"),
## Coordinate Reference Systems
wgs84 = CRS("+proj=longlat +ellps=WGS84",
doCheckCRSArgs = FALSE),
merc = CRS("+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs",
doCheckCRSArgs = FALSE),
eust = "MOOD has received funding from the EU Horizon 2020 Research and Innovation programme under grant agreement No 874850.",
report_euro_html =
rmarkdown::render(
knitr_in("src/Covid19MortalityEurope.Rmd"),
# knit_root_dir = "../public", # Is this necessary or convenient?
output_dir = "public", # https://github.com/ropensci/drake/issues/742
output_format =
bookdown::pdf_document2(
dev = "pdf",
includes = list(
in_header = "preamble.tex",
before_body = "before_body.tex"),
toc = T,
toc_depth = 3,
number_sections = T,
latex_engine = "xelatex"
),
output_file = file_out("public/covid19MortalityEurope.pdf"),
quiet = FALSE
),
## report_wcafrica_html =
## rmarkdown::render(
## knitr_in("src/Covid19MortalityWCAfrica.Rmd"),
## ## knit_root_dir = "../public", # Is this necessary or convenient?
## output_dir = "public", # https://github.com/ropensci/drake/issues/742
## output_format =
## rmdformats::readthedown(
## toc_depth = 3,
## lightbox = T,
## gallery = T,
## use_bookdown = T,
## number_sections = T),
## output_file = file_out("public/covid19MortalityWCAfrica.html"),
## quiet = FALSE
## ),
# WEBSITE AND README ------------------------------------------------------
readme_md =
rmarkdown::render(
knitr_in("README.Rmd"),
output_file = file_out("README.md"),
quiet = FALSE
),
index_html =
## Render to html within public
rmarkdown::render(
knitr_in("README.Rmd"),
output_dir = "public", # https://github.com/ropensci/drake/issues/742
output_file = file_out("public/index.html"),
quiet = FALSE
),
)
output_dir = "public", # https://github.com/ropensci/drake/issues/742
output_format =
rmdformats::readthedown(
dev = "png",
toc_depth = 3,
lightbox = T,
gallery = T,
use_bookdown = T,
number_sections = T),
output_file =
file_out("public/covid19MortalityEurope.html"),
quiet = FALSE
),
report_euro_pdf =
rmarkdown::render(
knitr_in("src/Covid19MortalityEurope.Rmd"),
# knit_root_dir = "../public", # Is this necessary or convenient?
output_dir = "public", # https://github.com/ropensci/drake/issues/742
output_format =
bookdown::pdf_document2(
dev = "pdf",
includes = list(
in_header = "preamble.tex",
before_body = "before_body.tex"),
toc = T,
toc_depth = 3,
number_sections = T,
latex_engine = "xelatex"
),
output_file = file_out("public/covid19MortalityEurope.pdf"),
quiet = FALSE
),
report_euro_docx =
rmarkdown::render(
knitr_in("src/Covid19MortalityEurope.Rmd"),
# knit_root_dir = "../public", # Is this necessary or convenient?
output_dir = "public", # https://github.com/ropensci/drake/issues/742
output_format =
bookdown::word_document2(
dev = "png",
toc = T,
toc_depth = 3,
number_sections = T
),
output_file = file_out("public/covid19MortalityEurope.docx"),
quiet = FALSE
),
## report_wcafrica_html =
## rmarkdown::render(
## knitr_in("src/Covid19MortalityWCAfrica.Rmd"),
## ## knit_root_dir = "../public", # Is this necessary or convenient?
## output_dir = "public", # https://github.com/ropensci/drake/issues/742
## output_format =
## rmdformats::readthedown(
## toc_depth = 3,
## lightbox = T,
## gallery = T,
## use_bookdown = T,
## number_sections = T),
## output_file = file_out("public/covid19MortalityWCAfrica.html"),
## quiet = FALSE
## ),
# WEBSITE AND README ------------------------------------------------------
readme_md =
rmarkdown::render(
knitr_in("README.Rmd"),
output_file = file_out("README.md"),
quiet = FALSE
),
index_html =
## Render to html within public
rmarkdown::render(
knitr_in("README.Rmd"),
output_dir = "public", # https://github.com/ropensci/drake/issues/742
output_file = file_out("public/index.html"),
quiet = FALSE
),
)
future::plan(future.callr::callr)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment