forked from eco4cast/predictability
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_targets.R
More file actions
132 lines (127 loc) · 4.04 KB
/
_targets.R
File metadata and controls
132 lines (127 loc) · 4.04 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
##' Targets file for pipeline management
##' AUTHOR: Cole B. Brookson
##' DATE OF CREATION: 2022-10-14
#'
#' This targets file contains all targets to run this analysis. If you are not
#' familiar with the targets package, see the documentation here:
#' https://books.ropensci.org/targets/
#'
#' All functions are documented using the roxygen2 framework and the docstring
#' library. Every function is named using `snake_case`, and every target is
#' named using `camelCase`
#'
# set up =======================================================================
library(targets)
library(tarchetypes)
library(here)
# read in function files
source(here::here("./src/R/functions_global.R"))
source(here::here("./src/R/functions_neon_data.R"))
source(here::here("./src/R/functions_permutation_entropy.R"))
source(here::here("./src/R/functions_autocorr.R"))
source(here::here("./src/R/functions_check_neon_data.R"))
# set the packages
targets::tar_option_set(
packages = c(
"readr", "here", "entropy", "magrittr", "dplyr", "ggplot2",
"tidyr", "ggtext", "patchwork", "ggthemes"
),
error = "stop"
)
list(
# data related targets =======================================================
tar_target(
downloadNeonData,
pull_data(
# write controls if copies of the files should be written to the local
write = TRUE
)
),
# autocorrelation plots ======================================================
#' For each data object we're working with, we want a plot of the partial
#' and full autocorrelation for each location of each data object
tar_target(ticksAutocorr, autocorr(
data = get_data_csv(here::here("./data/efi-neon-data/ticks.csv")),
subfolder = "ticks-by-site",
datatype = "ticks"
)),
tar_target(terrDailyAutocorr, autocorr(
data = get_data_csv(
here::here("./data/efi-neon-data/terrestrial-daily.csv")
),
subfolder = "terr-daily-by-site",
datatype = "terr-daily"
)),
tar_target(terr30minsAutocorr, autocorr(
data = get_data_csv(
here::here("./data/efi-neon-data/terrestrial-30-mins.csv")
),
subfolder = "terr-30min-by-site",
datatype = "terr-30min"
)),
tar_target(aquaticHourlyAutocorr, autocorr(
data = get_data_csv(
here::here("./data/efi-neon-data/aquatic-hourly.csv")
),
subfolder = "aquatic-hourly-by-site",
datatype = "aquatic-hourly"
)),
tar_target(aquaticDailyAutocorr, autocorr(
data = get_data_csv(
here::here("./data/efi-neon-data/aquatic-daily.csv")
),
subfolder = "aquatic-daily-by-site",
datatype = "aquatic-daily"
)),
tar_target(beetlesAutocorr, autocorr(
data = get_data_csv(
here::here("./data/efi-neon-data/beetles.csv")
),
subfolder = "beetles-by-site",
datatype = "beetles"
)),
tar_target(phenologyAutocorr, autocorr(
data = get_data_csv(
here::here("./data/efi-neon-data/phenology.csv")
),
subfolder = "phenology-by-site",
datatype = "phenology"
)),
# prep info for permutation entropy ==========================================
tar_target(terrDailyPECheck, wpe_check_neon_data(
df = get_data_csv(
here::here("./data/efi-neon-data/terrestrial-daily.csv")
),
challenge = "terr-daily"
)),
tar_target(terr30minsPECheck, wpe_check_neon_data(
df = get_data_csv(
here::here("./data/efi-neon-data/terrestrial-30-mins.csv")
),
challenge = "terr-30min"
)),
tar_target(aquaticHourlyPECheck, wpe_check_neon_data(
df = get_data_csv(
here::here("./data/efi-neon-data/aquatic-hourly.csv")
),
challenge = "aquatic-hourly"
)),
tar_target(aquaticDailyPECheck, wpe_check_neon_data(
df = get_data_csv(
here::here("./data/efi-neon-data/aquatic-daily.csv")
),
challenge = "aquatic-daily"
)),
tar_target(beetlesPECheck, wpe_check_neon_data(
df = get_data_csv(
here::here("./data/efi-neon-data/beetles.csv")
),
challenge = "beetles"
)),
tar_target(phenologyPECheck, wpe_check_neon_data(
df = get_data_csv(
here::here("./data/efi-neon-data/phenology.csv")
),
challenge = "phenology"
))
)