-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_targets.R
93 lines (89 loc) · 2.13 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
library(targets)
library(tarchetypes)
library(here)
library(purrr)
here::i_am("_targets.R")
# another test
# second ish test``
# test commit need a second test
# Run the R scripts in the functions/ folder with your custom functions:
tar_source(here("functions", "functions.R"))
options(clustermq.schedular = "multicore")
tar_option_set(
packages = c(
"tidyverse",
"targets",
"here",
"DBI",
"RSQLite"
),
format = "rds"
)
url1 <- "https://docs.google.com/spreadsheets/d/107qO9HOfhtj7n7oz19FW0Qk1zAsqfWeF9M8GKsoEQ_w/edit?usp=drive_link"
list(
tar_target(
db_path,
build_a_db(file_path),
format = "rds"
),
tar_target(
market_info,
download_data(here("data", "market-orders-latest.v3.csv.bz2"),
"https://data.everef.net/market-orders/market-orders-latest.v3.csv.bz2"),
format = "rds"
),
tar_target(
invgroup,
download_data(here("data", "invGroups.csv.bz2"),
"https://www.fuzzwork.co.uk/dump/latest/invGroups.csv.bz2"),
format = "rds"
),
tar_target(
invtypes,
download_data(here("data", "invTypes.csv.bz2"),
"https://www.fuzzwork.co.uk/dump/latest/invTypes.csv.bz2" ),
format = "rds"
),
tar_target(
staStation,
download_data(here("data", "staStation.csv.bz2"),
"https://www.fuzzwork.co.uk/dump/latest/staStations.csv.bz2" ),
format = "rds"
),
tar_target(
invmeta_groups,
download_data(here("data", "invMetaGroups.csv.bz2"),
"https://www.fuzzwork.co.uk/dump/latest/invMetaGroups.csv.bz2" ),
format = "rds"
),
tar_target(
invMetaGroups_db,
writeto_db(invmeta_groups, db_path),
format = "rds"
),
tar_target(
invgroup_db,
writeto_db(invgroup, db_path),
format = "rds"
),
tar_target(
inv_types_db,
writeto_db(invtypes, db_path),
format = "rds"
),
tar_target(
station_db,
writeto_db(staStation, db_path),
format = "rds"
),
tar_target(
market_information_db,
writeto_db(market_info, db_path),
format = "rds"
),
tar_target(
write_db_to_excel,
link_excel_to_db(url1),
format = "rds"
)
)