From 6061babfb8a9d91a257754504fb57726848e6103 Mon Sep 17 00:00:00 2001 From: "Mattan S. Ben-Shachar" Date: Sat, 7 Dec 2024 00:36:12 +0200 Subject: [PATCH] support interperting marix/array --- R/interpret.R | 3 +++ 1 file changed, 3 insertions(+) diff --git a/R/interpret.R b/R/interpret.R index ca659ba7..c2afe096 100644 --- a/R/interpret.R +++ b/R/interpret.R @@ -159,6 +159,9 @@ interpret.numeric <- function(x, rules, name = attr(rules, "rule_name"), if (length(x_tran) > 1) { out <- vapply(x_tran, .interpret, rules = rules, FUN.VALUE = character(1L)) + if (is.matrix(x_tran) || is.array(x_tran)) { + out <- structure(out, dim = dim(x_tran), dimnames = dimnames(x_tran)) + } } else { out <- .interpret(x_tran, rules = rules) }