From 143e218baa19cbe9c63196a48672b4fae69ea7fc Mon Sep 17 00:00:00 2001 From: go_gonzo Date: Fri, 17 Nov 2023 06:37:16 +0100 Subject: [PATCH] replace [[ i ]][[ j ]] to [i, j] --- R/data_extract_module.R | 4 ++-- R/get_merge_call.R | 2 +- R/merge_datasets.R | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/R/data_extract_module.R b/R/data_extract_module.R index 4e924c48..33434648 100644 --- a/R/data_extract_module.R +++ b/R/data_extract_module.R @@ -456,8 +456,8 @@ data_extract_srv.list <- function(id, datasets, data_extract_spec, join_keys = N ) # get keys out of join_keys - if (!is.null(join_keys)) { - keys <- sapply(names(datasets), simplify = FALSE, function(x) join_keys[[x]][[x]]) + if (length(join_keys)) { + keys <- sapply(names(datasets), simplify = FALSE, function(x) join_keys[x, x]) } else { keys <- sapply(names(datasets), simplify = FALSE, function(x) character(0)) } diff --git a/R/get_merge_call.R b/R/get_merge_call.R index dd7ad272..4d669d20 100644 --- a/R/get_merge_call.R +++ b/R/get_merge_call.R @@ -130,7 +130,7 @@ get_merge_key_grid <- function(selector_list, join_keys = teal.data::join_keys() get_merge_key_pair( selector_from, selector_to, - join_keys[[selector_from$dataname]][[selector_to$dataname]] + join_keys[selector_from$dataname, selector_to$dataname] ) } ) diff --git a/R/merge_datasets.R b/R/merge_datasets.R index 98fcc79c..93fa1da7 100644 --- a/R/merge_datasets.R +++ b/R/merge_datasets.R @@ -280,7 +280,7 @@ are_needed_keys_provided <- function(join_keys, merged_selector_list) { } do_join_keys_exist <- function(dataset_name1, dataset_name2, join_keys) { - length(join_keys[[dataset_name1]][[dataset_name2]] > 0) + length(join_keys[dataset_name1, dataset_name2] > 0) } datasets_names <- vapply(merged_selector_list, function(slice) slice[["dataname"]], FUN.VALUE = character(1))