generated from byu-transpolab/template_quarto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
_targets.R
106 lines (79 loc) · 2.11 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
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
#### Setup #############################################################
library(targets)
library(tarchetypes)
library(haven)
tar_option_set(
packages = c("tidyverse", "wesanderson", "scales", "modelsummary", "mlogit", "broom", "labelled", "dfidx", "modelsummary"),
# memory = "transient",
# garbage_collection = TRUE,
# format = "qs",
)
tar_source()
#### List targets ######################################################
# Misc ####
misc_targets <- tar_plan(
plot_lims = list(x = c(-112.15,-111.6), y = c(40.2,40.8)),
)
# Data ####
data_targets <- tar_plan(
tar_file(utah_hhts_trips, "data/ut_hhts/ut_hhts_2012_trip_data.csv.gz"),
tar_file(utah_hhts_hh, "data/ut_hhts/ut_hhts_2012_hh_data.csv.gz"),
tar_file(utah_hhts_taz, "data/ut_hhts/ut_hhts_2012_taz_data.csv.gz"),
ut_hhts = clean_ut_hhts(
trips = utah_hhts_trips,
hh = utah_hhts_hh,
taz = utah_hhts_taz
),
tar_file(nhts_hhpub, "data/nhts/HHPUB.sav.gz"),
tar_file(nhts_perpub, "data/nhts/PERPUB.sav.gz"),
tar_file(nhts_trippub, "data/nhts/TRIPPUB.sav.gz"),
tar_file(nhts_vehpub, "data/nhts/VEHPUB.sav.gz"),
nhts = clean_nhts(
trips = nhts_trippub,
hh = nhts_hhpub,
per = nhts_perpub,
veh = nhts_vehpub
),
)
# Vehicle ownership ####
veho_targets <- tar_plan(
# clean_veho = clean_veh_own(hhts_hh),
# veho_summary = veh_own_summary(clean_veho),
# veho_model = estimate_veho(clean_veho),
veho_models = estimate_veho(ut_hhts$hh)
)
# Work From Home ####
wfh_targets <- tar_plan(
#WFH
wfh_models = estimate_wfh(haven::zap_labels(nhts$per)),
# Telecommuting Frequency
tc_models = estimate_tc(haven::zap_labels(nhts$per))
)
# Network ####
network_targets <- tar_plan(
)
# Mandatory location ####
mandatory_location_targets <- tar_plan(
)
# CDAP ####
cdap_targets <- tar_plan(
)
# Tours ####
tour_targets <- tar_plan(
cleaned_tours = clean_tours(ut_hhts$trips)
)
# Trips ####
trip_targets <- tar_plan(
)
#### Run all targets ###################################################
tar_plan(
misc_targets,
data_targets,
network_targets,
wfh_targets,
veho_targets,
mandatory_location_targets,
cdap_targets,
tour_targets,
trip_targets,
)