Closed gmbecker closed 9 months ago
The culprit is the use of x (the original input) rather than mat (the input updated upstream in the function by do_cell_fnotes_wrap) in this line. We need the updated row grouping not the original.
x
mat
do_cell_fnotes_wrap
https://github.com/insightsengineering/formatters/blob/3178e6573d5e583e5c06846d00322392f6222131/R/tostring.R#L531
Probably good to check any other uses of throughout the function too, though the above is definately the acute problem I ran into.
repro (using rtables for convenience):
df <- data.frame(cat =c( "really long thing its so long", "reasonable thing", "short"), value = c(6, 3, 10)) lyt <- basic_table() %>% split_rows_by("cat", section_div = " ") %>% analyze("value") tbl <- build_table(lyt, df) cat(toString(tbl)) # works cw <- propose_column_widths(tbl) cw[1] <- 11 cat(toString(tbl, widths = cw)) ## fails
related:
The culprit is the use of
x
(the original input) rather thanmat
(the input updated upstream in the function bydo_cell_fnotes_wrap
) in this line. We need the updated row grouping not the original.https://github.com/insightsengineering/formatters/blob/3178e6573d5e583e5c06846d00322392f6222131/R/tostring.R#L531
Probably good to check any other uses of throughout the function too, though the above is definately the acute problem I ran into.
repro (using rtables for convenience):