From 1ac18dcf70499131a92640b0a114590d84bfd463 Mon Sep 17 00:00:00 2001 From: Andrew Gene Brown Date: Thu, 16 Nov 2023 20:53:12 -0800 Subject: [PATCH] fix for #315 --- R/get_SDA_interpretation.R | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/R/get_SDA_interpretation.R b/R/get_SDA_interpretation.R index 2a239a60..efc29fec 100644 --- a/R/get_SDA_interpretation.R +++ b/R/get_SDA_interpretation.R @@ -902,7 +902,11 @@ get_SDA_interpretation <- function(rulename, cn <- colnames(x)[grepl("^reason_", colnames(x))] for (n in cn) { x <- cbind(x, data.table::rbindlist(lapply(strsplit(x[[n]], "; "), function(x) { - x3 <- do.call('rbind', strsplit(gsub("(.*) \"(.*)\" \\((.*)\\)", "\\1;\\2;\\3", x), ";")) + x3 <- as.data.frame(data.table::rbindlist(lapply( + strsplit(gsub( + "(.*) \"(.*)\" \\((.*)\\)", "\\1;\\2;\\3", x + ), ";"), function(y) as.data.frame(t(y)) + ), fill = TRUE)) if (ncol(x3) == 3) { x4 <- as.data.frame(as.list(x3[, 3])) colnames(x4) <- paste0("rating_", n , "_", .cleanRuleColumnName(x3[, 1]))