-
Notifications
You must be signed in to change notification settings - Fork 0
/
_targets.R
34 lines (28 loc) · 1.25 KB
/
_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
## Set to connect to Hipergator by ssh
# You will be prompted to enter your
# gatorlink password and select an option for 2-factor authentication. If you've
# set up an SSH key, then you need to use port 2222 for it to work, hence the '-p
# 2222 ' below.
options(
clustermq.scheduler = "ssh",
clustermq.template = "ssh_clustermq.tmpl", #custom SSH template to use R 4.0
clustermq.ssh.host = "-p 2222 ericscott@hpg.rc.ufl.edu", # use your user and host or set up in ~/.ssh/config.
clustermq.ssh.timeout = 30, #longer timeout helps with 2FA
clustermq.ssh.log = "~/cmq_ssh.log" # log for easier debugging
)
## Load your packages, e.g. library(targets).
source("./packages.R")
lapply(list.files("R", full.names = TRUE), source)
## Set options
options(tidyverse.quiet = TRUE)
tar_option_set(deployment = "main") #default to running targets locally
## tar_plan supports drake-style targets and also tar_target()
tar_plan(
many_vects = make_vects(),
means = map(many_vects, ~mean(.x)),
sds = map(many_vects, ~sd(.x)),
# these targets should be able to run in parallel on HiperGator:
tar_target(means_mean, ~mean(unlist(means)), deployment = "worker"),
tar_target(sd_means, ~mean(unlist(sds)), deployment = "worker"),
tar_render(readme, "./README.Rmd")
)