Skip to content

Commit

Permalink
fix for #315
Browse files Browse the repository at this point in the history
  • Loading branch information
brownag committed Nov 17, 2023
1 parent f4e1d4e commit 1ac18dc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion R/get_SDA_interpretation.R
Original file line number Diff line number Diff line change
Expand Up @@ -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]))
Expand Down

0 comments on commit 1ac18dc

Please sign in to comment.