From 041192db80a80f308f74ba2df3d142537255c138 Mon Sep 17 00:00:00 2001 From: aho Date: Fri, 4 Nov 2022 10:13:39 +0100 Subject: [PATCH] Bugfix for improved Subset() that along cannot be NULL. --- R/Start.R | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/R/Start.R b/R/Start.R index 43aa6d1..f86a98b 100644 --- a/R/Start.R +++ b/R/Start.R @@ -2661,8 +2661,15 @@ Start <- function(..., # dim = indices/selectors, selector_indices_to_take <- which(selector_file_dim_array == j, arr.ind = TRUE)[1, ] names(selector_indices_to_take) <- names(selector_file_dims) selector_store_position[names(selector_indices_to_take)] <- selector_indices_to_take - sub_array_of_selectors <- Subset(selector_array, names(selector_indices_to_take), - as.list(selector_indices_to_take), drop = 'selected') + #TODO: Check if the non-subset part makes sense. "selector_indices_to_take" is an array if + # "selector_file_dims" is not 1 (if selector is an array with a file_dim dimname, ie., + # time = [sdate = 2, time = 4]. + if (!is.null(names(selector_indices_to_take))) { + sub_array_of_selectors <- Subset(selector_array, names(selector_indices_to_take), + as.list(selector_indices_to_take), drop = 'selected') + } else { + sub_array_of_selectors <- selector_array + } if (debug) { if (inner_dim %in% dims_to_check) { -- GitLab