-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_preprocessing.R
29 lines (24 loc) · 1.14 KB
/
_preprocessing.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
library(targets)
library(tarchetypes)
# Set target options:
tar_option_set(
packages = c("tibble", "sf", "tidyverse", "reticulate", "rgee", "weathermetrics")
)
# source scripts
tar_source("src/get-era5-indices.R")
tar_source("src/weather-analysis-tools.R")
#paths
matchedPairsDefol <- "~/Desktop/OneDrive - University of Toronto/Data/chapter_3/on-qc-defol.shp" #"<path/to/my/file>"
matchedPairsNonDefol <- "~/Desktop/OneDrive - University of Toronto/Data/chapter_3/on-qc-nondefol.shp" #"<path/to/my/file>"
defolInfo <- "~/Work/PhD/sbw-fire-interactions/nbr-recovery/data/paired_fires/on-qc-defol-table.csv"#"<path/to/my/file>"
# pipeline
list(
tar_target(matchedDefolFile, matchedPairsDefol, format = "file"),
tar_target(matchedNonDefolFile, matchedPairsNonDefol, format = "file"),
tar_target(defolShp, sf::st_read(matchedDefolFile)),
tar_target(NondefolShp, sf::st_read(matchedNonDefolFile)),
tar_target(defolInfoFile, defolInfo, format = "file"),
tar_target(defolInfoTable, readr::read_csv(defolInfoFile)),
tar_target(preppedData, cleanDataDefol(defolShp, NondefolShp, defolInfoTable)),
tar_target(data.tsdgt1, removeTsd0(preppedData))
)