From 7ae198cf35b368b5dfd50000a129ee17c1e46084 Mon Sep 17 00:00:00 2001 From: Eva Rifa Date: Tue, 28 Mar 2023 09:47:08 +0200 Subject: [PATCH] Correct for multiple variable indices and attrs --- R/CST_Subset.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/R/CST_Subset.R b/R/CST_Subset.R index 9f247e27..2a5defbf 100644 --- a/R/CST_Subset.R +++ b/R/CST_Subset.R @@ -100,13 +100,13 @@ CST_Subset <- function(x, along, indices, drop = FALSE, var_dim = NULL, dim_name <- along[dimension] index <- indices[[dimension]] if ((!is.null(var_dim)) && (dim_name == var_dim)) { - x$attrs$Variable$varName <- x$coords[[dim_name]][1] + x$attrs$Variable$varName <- as.vector(x$coords[[dim_name]]) } if ((!is.null(dat_dim)) && (dim_name == dat_dim)) { - x$attrs$Datasets <- x$attrs$Datasets[x$coords[[dim_name]][1]] + x$attrs$Datasets <- as.vector(x$coords[[dim_name]]) } if ((!is.null(x$attrs$source_files)) && - (dim_name %in% names(dim(x$attrs$source_files)))) { + (dim_name %in% names(dim(x$attrs$source_files)))) { x$attrs$source_files <- ClimProjDiags::Subset(x$attrs$source_files, along = dim_name, indices = index, -- GitLab