-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdataprep_error_locate.r
More file actions
31 lines (23 loc) · 1009 Bytes
/
dataprep_error_locate.r
File metadata and controls
31 lines (23 loc) · 1009 Bytes
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
rule_matrix <- load_input(file_name = file.path("input_files", stringr::str_glue("rule_matrix_{YEAR}.csv")))
data <- prepare_data(
file_name = FILE_NAME_INPUT_DATA,
use_eo = use_eo,
conf_vars = rule_matrix$Naam
)
# read file with interstat weights per record
weights_interstat <- load_input(file_name = FILE_NAME_WEIGHTS)
if (use_interstat_rules_soft) { # add weights for soft edit rules
weights_interstat_soft <- load_input(file_name = FILE_NAME_WEIGHTS_SOFT)
weights_interstat <- cbind(weights_interstat,
weights_interstat_soft)
}
if (beidselection) {
# only keep BE_IDs that are included in FILE_NAME_BEIDSELECTION
beidsel <- load_input(file_name = FILE_NAME_BEIDSELECTION)
data <- data %>%
dplyr::inner_join(beidsel %>% dplyr::select(BE_ID),
by = 'BE_ID')
weights_interstat <- weights_interstat %>%
dplyr::inner_join(beidsel %>% dplyr::select(BE_ID),
by = 'BE_ID')
}