From 42c1117a43853b955377d89f57c5266f3e397957 Mon Sep 17 00:00:00 2001 From: Eva Rifa Date: Mon, 2 Oct 2023 12:19:31 +0200 Subject: [PATCH] Correct subset indices for metadata --- R/CST_Subset.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/CST_Subset.R b/R/CST_Subset.R index 372e3981..bc3915e8 100644 --- a/R/CST_Subset.R +++ b/R/CST_Subset.R @@ -137,7 +137,7 @@ CST_Subset <- function(x, along, indices, drop = FALSE, var_dim = NULL, for (variable in 1:length(names(x$attrs$Variable$metadata))) { if (any(along %in% names(dim(x$attrs$Variable$metadata[[variable]])))) { dim_along <- along[along %in% names(dim(x$attrs$Variable$metadata[[variable]]))] - index_along <- indices[[which(along == dim_along)]] + index_along <- indices[match(dim_along, along)] x$attrs$Variable$metadata[[variable]] <- .subset_with_attrs(x$attrs$Variable$metadata[[variable]], along = dim_along, indices = index_along, -- GitLab