-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_targets.R
56 lines (47 loc) · 982 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
library(targets)
library(tarchetypes)
# Custom functions
source("R/functions.R")
# Set target-specific options such as packages:
tar_option_set(
packages = c("tidyverse",
"stringr",
"rvest",
"polite")
)
# End this file with a list of target objects.
list(
# User selection: suburb name and number of pages (starting with 0)
tar_target(
suburb,
suburb <- "Shenton Park"
),
tar_target(
page_end,
page_end <- "1"
),
# Run some functions
tar_target(
suburb_addresses,
scrape_addresses(
suburb = suburb,
page_end = page_end)
),
tar_target(
property_info,
scrape_property_info(
suburb = suburb,
page_end = page_end)
),
tar_target(
properties_list_form,
map2(
.x = property_info,
.y = suburb_addresses,
.f = ~ c(.y, .x))
),
tar_target(
df_properties,
make_df_properties(properties_list_form)
)
)