-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path_targets.R
More file actions
72 lines (58 loc) · 2.47 KB
/
_targets.R
File metadata and controls
72 lines (58 loc) · 2.47 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# Created by use_targets().
# Load packages required to define the pipeline:
library(targets)
library(tarchetypes)
# Set target options:
tar_option_set(
packages = c("tidyverse"),
error = "continue"
)
# Run the R scripts with custom functions:
tar_source(files = c(
"1_inventory.R",
"2_download.R",
"3_harmonize.R",
"4_analysis.R",
"create_bookdown.R"))
# The list of targets/steps (these steps from MRB)
config_targets <- list(
# WQP config --------------------------------------------------------------
# Things that often used to be YAMLs, and which probably should be again in
# the future. For right now I'm putting them as targets so I can conceptualize
# the workflow components more easily
# Date range of interest
tar_target(wq_dates,
list(
start_date = "1970-01-01",
end_date = Sys.Date()
)),
# Define which parameter groups (and CharacteristicNames) to return from WQP.
# Different options for parameter groups are represented in the first level of
# 1_inventory/cfg/wqp_codes.yml. This yml file is meant to provide a starting
# place for an analysis and does not represent a definitive list of characteristic
# names. Which characteristic names to include for any given parameter group may
# change depending on the user or application, so the yml file can be edited to
# omit characteristic names or include others, to change top-level parameter names,
# or to customize parameter groupings.
tar_target(param_groups_select,
c("chlorophyll", "secchi", "doc", "tss"#, "temperature"
)),
# WQP inventory -----------------------------------------------------------
# Specify arguments to WQP queries
# see https://www.waterqualitydata.us/webservices_documentation for more information
tar_target(wqp_args,
list(sampleMedia = c("Water","water"),
siteType = c("Lake, Reservoir, Impoundment",
"Stream",
"Estuary",
# Remove this in the future
"Facility"),
# Return sites with at least one data record
minresults = 1,
startDateLo = wq_dates$start_date,
startDateHi = wq_dates$end_date))
)
# Full targets list
c(config_targets,
p1_targets_list, p2_targets_list, p3_targets_list, p4_targets_list,
bookdown_targets_list)