diff --git a/R/zzz.R b/R/zzz.R index 662624d9cb94cff6436d71016703c558c974c579..8f27f87eab6638592973c03c5c7ca2316364a11f 100644 --- a/R/zzz.R +++ b/R/zzz.R @@ -13,6 +13,11 @@ x <- x[as.vector(y)] } dim(x) <- old_dims[new_order] + if (length(attr_bk) > 0) { + if (names(attr_bk) == 'dimnames') { + attr_bk <- list(dimnames = attr_bk$dimnames[new_order]) + } + } attributes(x) <- c(attributes(x), attr_bk) x }