-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathorchestratie.r
More file actions
61 lines (51 loc) · 2.33 KB
/
orchestratie.r
File metadata and controls
61 lines (51 loc) · 2.33 KB
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
# clear memory
rm(list = ls())
gc()
source("./global.r", local = TRUE) # load global settings
source("./functions/fct_error_locate.r", local = TRUE) # load parallelised process_row_errorlocate function
source("./functions/fct_match_restrictions_lp.r", local = TRUE) # load auxiliary functions for adjusting imputed values in step 2
source("./functions/fct_dataprep.r", local = TRUE) # load dataprep functions
source("./functions/fct_export.r", local = TRUE) # load export functions
# Orchestration error locate function
process_row_errorlocate <- function(Stap3Doen = TRUE,
data_row,
weights_interstat_row,
use_eo,
use_linear_rules,
use_interstat_rules_soft) {
source("./stap_0.r", local = TRUE) #data laden / data prep
source("./stap_1.r", local = TRUE)
if (stap1_gelukt) source("./stap_2.r", local = TRUE)
if (stap2_gelukt) source("./stap_3.r", local = TRUE)
return(results)
}
# Load data and weights
source("./dataprep_error_locate.r", local = TRUE)
# Call to start_errorlocate
res <- start_errorlocate(Stap3Doen = Stap3Doen,
data = data,
weights_interstat = weights_interstat,
n_start = 1,
n_end = nrow(data),
rule_matrix = rule_matrix,
prefix_output = prefix_output,
save_rdata = save_rdata,
use_eo = use_eo,
use_linear_rules = use_linear_rules,
use_interstat_rules_soft = use_interstat_rules_soft,
use_calculator = use_calculator)
export_output(
Stap3Doen = Stap3Doen,
results_errorlocate = res$results_errorlocate,
results_overhevelen = res$results_overhevelen,
results_optelling_nul = res$results_optelling_nul,
results_ps = res$results_ps,
results_ded = res$results_ded,
results_imp = res$results_imp,
results_mr = res$results_mr,
results_final = res$results_final,
data_org = data,
prefix_output = prefix_output,
save_rdata = save_rdata,
conf_vars = rule_matrix$Naam[!is.na(rule_matrix$PS) & rule_matrix$PS != '']
)