-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_targets.R
75 lines (59 loc) · 1.75 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
options(
TARGETS_VERBOSE = TRUE,
TARGETS_N_CORES = 10 # ver opcoes disponiveis em C:\StreetMap\NewLocators
)
data.table::setDTthreads(getOption("TARGETS_N_CORES"))
suppressPackageStartupMessages({
library(geocodebr)
library(targets)
library(dplyr)
library(bench)
library(data.table)
library(duckdb)
library(ggplot2)
# library(ipeadatalake)
# library(arrow)
#library(reticulate)
#library(geocodepro)
})
# Run the R scripts in the R/ folder with your custom functions:
# tar_source('./R/python_env.R')
tar_source('./R/sample_data.R')
tar_source('./R/benchmark.R')
tar_source('./R/geocode_functions.R')
tar_source('./R/figure_time.R')
tar_source('./R/compare_precision.R')
tar_option_set(seed = 42)
# reticulate::use_condaenv("C://Program Files/ArcGIS/Pro/bin/Python/envs/arcgispro-py3")
# targets
list(
tar_target(
name = sample_data,
command = generate_sample_data(sample_size=100000),
format = "rds" # Efficient storage for general data objects.
),
tar_target(
name = geocodebr_output,
command = geocodebr_fun(input_df=sample_data),
format = "rds" # Efficient storage for general data objects.
),
tar_target(
name = geocodepro_output,
command = geocodepro_fun(input_df=sample_data),
format = "rds" # Efficient storage for general data objects.
),
tar_target(
name = benchmark_time,
command = benchmark_time(input_df=sample_data),
format = "rds" # Efficient storage for general data objects.
),
tar_target(
name = fig_benchmark_time,
command = figure_time(bm=benchmark_time)
),
tar_target(
name = compare_result_categories,
command = compare_precison(geocodebr_output, geocodepro_output),
format = "rds" # Efficient storage for general data objects.
)
)