From 780295f3f7c28b6fa6a56e19081d7a812e4fe72c Mon Sep 17 00:00:00 2001 From: "Andrew G. Brown" Date: Thu, 26 Oct 2023 18:24:35 -0700 Subject: [PATCH] get_SDA_interpretation: update simplified rule names to retain inequality information - Updates `.cleanRuleColumnName()` - note that this will add several characters to calculated column names for several `mrulename`, most of which are state-specific --- R/get_SDA_interpretation.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/get_SDA_interpretation.R b/R/get_SDA_interpretation.R index 2a9ef607..2a239a60 100644 --- a/R/get_SDA_interpretation.R +++ b/R/get_SDA_interpretation.R @@ -779,7 +779,7 @@ get_SDA_interpretation <- function(rulename, ) } -.cleanRuleColumnName <- function(x) gsub("[^A-Za-z0-9]", "", x) +.cleanRuleColumnName <- function(x) gsub("[^A-Za-z0-9]", "", gsub(">", "GT", gsub("<", "LT", gsub("=", "EQ", x, fixed = TRUE), fixed = TRUE), fixed = TRUE)) .interpretation_by_condition <- function(interp, where_clause, dominant = TRUE, sqlite = FALSE) { aggfun <- "STRING_AGG(CONCAT(rulename, ' \"', interphrc, '\" (', interphr, ')'), '; ')"