generated from byu-transpolab/template_bookdown
-
Notifications
You must be signed in to change notification settings - Fork 0
/
_targets.R
38 lines (28 loc) · 973 Bytes
/
_targets.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
30
31
32
33
34
35
36
37
38
library(targets)
library(tarchetypes)
# This is an example _targets.R file. Every
# {targets} pipeline needs one.
# Use tar_script() to create _targets.R and tar_edit()
# to open it again for editing.
# Then, run tar_make() to run the pipeline
# and tar_read(summary) to view the results.
# Set target-specific options such as packages.
tar_option_set(packages = c("tidyverse", "bookdown"))
# Define custom functions and other global objects.
# This is where you write source(\"R/functions.R\")
# if you keep your functions in external scripts.
source("R/functions.R")
# Targets necessary to build your data and run your model
data_targets <- list(
tar_target(data, data.frame(x = sample.int(100), y = sample.int(100))),
tar_target(summary, summ(data)) # Call your custom functions as needed.
)
# Targets necessary to build the book / article
book_targets <- list(
tar_target(report, rmarkdown::)
)
# run all targets
list(
data_targets,
book_targets
)