diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..a9962c4fc5760c094ad55108a1852daeb4557dfe --- /dev/null +++ b/.gitignore @@ -0,0 +1,27 @@ +.Rproj.user +.Rproj.user/ +.Rhistory +.RData +.Ruserdata +.RProfile +.Renvironment +.DS_Store +1_fetch/out/* +1_fetch/in/* +1_fetch/src/* +2_process/in/* +2_process/src/* +2_process/out/* +3_visualize/in/* +3_visualize/src/* +3_visualize/out/* +!1_fetch/in/.empty +!1_fetch/src/.empty +!1_fetch/out/.empty +!2_process/in/.empty +!2_process/src/.empty +!2_process/out/.empty +!3_visualize/in/.empty +!3_visualize/src/.empty +!3_visualize/out/.empty +_targets/ diff --git a/1_fetch.R b/1_fetch.R new file mode 100644 index 0000000000000000000000000000000000000000..feff5e3a819c1272f699873184794291818d8700 --- /dev/null +++ b/1_fetch.R @@ -0,0 +1,23 @@ +source("1_fetch/src/fetch_utils.R") + +p1_targets <- list( + ##### Vulnerability indicators data ##### + tar_target(p1_sb_id, + '63f79d49d34e4f7eda456572'), + ##### Vulnerability indicators metadata ##### + tar_target(p1_vul_ind_xml, + download_from_sb(sb_id = p1_sb_id, + filename = 'Uncertainty_Summary.xml', + dest_dir = '1_fetch/out'), + format = 'file'), + ##### Uncertainty statistics for the indicators ##### + tar_target(p1_unc_stats_csv, + download_from_sb(sb_id = p1_sb_id, + filename = 'Uncertainty_Summary.csv', + dest_dir = '1_fetch/out'), + format = 'file'), + tar_target(p1_unc_stats, + readr::read_csv(p1_unc_stats_csv) |> + janitor::clean_names() + ) + ) \ No newline at end of file diff --git a/1_fetch/in/.empty b/1_fetch/in/.empty new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/1_fetch/out/.empty b/1_fetch/out/.empty new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/1_fetch/src/.empty b/1_fetch/src/.empty new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/2_process.R b/2_process.R new file mode 100644 index 0000000000000000000000000000000000000000..69c9e9938f355ff631796cd5a1aecd00e1042781 --- /dev/null +++ b/2_process.R @@ -0,0 +1,7 @@ +# source('1_fetch/src/file_utils.R') +# source('2_process/src/spatial_utils.R') +# source('2_process/src/data_utils.R') + +p2_targets <- list( + +) \ No newline at end of file diff --git a/2_process/in/.empty b/2_process/in/.empty new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/2_process/out/.empty b/2_process/out/.empty new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/2_process/src/.empty b/2_process/src/.empty new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/3_visualize.R b/3_visualize.R new file mode 100644 index 0000000000000000000000000000000000000000..6a4f6c4b1961a808fdd9d4ffdb5b894936e3a9cf --- /dev/null +++ b/3_visualize.R @@ -0,0 +1,6 @@ +# source('1_fetch/src/file_utils.R') +# source('3_visualize/src/plot_utils.R') + +p3_targets <- list( + +) \ No newline at end of file diff --git a/3_visualize/.empty b/3_visualize/.empty new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/3_visualize/in/.empty b/3_visualize/in/.empty new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/3_visualize/out/.empty b/3_visualize/out/.empty new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/_targets.R b/_targets.R new file mode 100644 index 0000000000000000000000000000000000000000..ef873ec69b10cb09a0438d2bf5a9b6665be34323 --- /dev/null +++ b/_targets.R @@ -0,0 +1,24 @@ +library(targets) +library(tarchetypes) # need version >= 0.6.0.9000 + +options(tidyverse.quiet = TRUE, timeout = 800) +tar_option_set(packages = c('tidyverse', + 'sf', + 'terra', + 'rmapshaper', + 'purrr', + 'raster', + 'magick', + 'janitor', + 'sbtools')) + +# Phase target makefiles +source("1_fetch.R") +source("2_process.R") +source("3_visualize.R") + +# Combined list of target outputs +c(p1_targets, + p2_targets, + p3_targets +) \ No newline at end of file diff --git a/vulnerability-indicators.Rproj b/vulnerability-indicators.Rproj new file mode 100644 index 0000000000000000000000000000000000000000..8e3c2ebc99e2e337f7d69948b93529a437590b27 --- /dev/null +++ b/vulnerability-indicators.Rproj @@ -0,0 +1,13 @@ +Version: 1.0 + +RestoreWorkspace: Default +SaveWorkspace: Default +AlwaysSaveHistory: Default + +EnableCodeIndexing: Yes +UseSpacesForTab: Yes +NumSpacesForTab: 2 +Encoding: UTF-8 + +RnwWeave: Sweave +LaTeX: pdfLaTeX