Closed xni7 closed 3 years ago
Thanks @xni7
@elimillera Does it make sense to trouble shoot this in safetyCharts or is this renderer going to be migrated over to Tplyr in a coming release?
Hey @xni7 thanks for the report. That was something I was thinking about when throwing this in. It was more for demoing Tplyr.
@jwildfire We're still planning out what our next round of updates Tplyr looks like so it might not be implemented for a little while. I'll put this on my todo list to check out.
Maybe not the most robust, but these changes implemented in #78 seem to work:
treatments<- unique(data[,settings$treatment_col])
treatment_vars <- paste0("var1_",treatments)
treatment_labels <- paste0(treatments, "\\line(N=**",treatments,"**)|", collapse=" ")
header <- paste0(" | | ",treatment_labels," Total\\line(N=**Total**)")
tab <- tplyr_tab %>%
Tplyr::build() %>%
arrange(.data$ord_layer_index, .data$ord_layer_1, .data$ord_layer_2) %>%
select(starts_with("row_label"), treatment_vars, var1_Total) %>%
Tplyr::add_column_headers(header, header_n = Tplyr::header_n(tplyr_tab))
as title suggested. @jwildfire @elimillera
Steps to replicate:
It seems to have to do with the hardcoded treatment labels in Line 91-95 below. https://github.com/SafetyGraphics/safetyCharts/blob/c37f3ac7883b15ab3d8a36e597dec85728657fd7/R/mod_demogRTF.R#L88