-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_targets.R
35 lines (27 loc) · 1.46 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
library(targets)
# 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.
# 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/DataMaker.R")
# Set target-specific options such as packages.
tar_option_set(packages = c("tidyverse", "sf", "ggplot2", "readxl", "leaflet", "gsubfn", "r5r", "rstudioapi",
"otpr", "leaflet", "tidycensus", "parallel", "haven",
"mlogit", "jsonlite", "VGAM", "modelsummary", "tigris",
"viridis", "ggspatial", "dplyr", "rgdal", "mice"))
options(tigris_use_cache = TRUE)
options(java.parameters = "-Xmx8G")
# End this file with a list of target objects.
list(
tar_target(data, create_data("Data/Utah_Grocery_And_Food_Stores__UDAF_.geojson", "Utah_County_Boundaries/Counties.shp")),
tar_target(exist_data, existing_data("Data/data_sanjuan.csv", "Data/data_utah.csv", "Data/data_saltlake.csv")),
tar_target(combined_data, combine_data(data, exist_data)),
#this target takes 2.5 hours to build so keep that in mind
tar_target(acs_data_table, get_acs_data(combined_data, "Utah_County_Boundaries/Counties.shp")),
tar_target(imputed_data, impute_data(acs_data_table))
)