Skip to content

Commit

Permalink
update ref_group column ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
clarkliming committed Oct 16, 2023
1 parent ae4f875 commit 2573465
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## rtables 0.6.4.9003
### New Features
* Added support for white spaces in all labels and text by redesigning of wrapping functions in `formatters`.
* `ref_group` in column splits will not change the order now.

### Bug Fixes
* Fixed a bug causing `Viewer` and `as_html` to fail when new line characters were added.
Expand Down
8 changes: 0 additions & 8 deletions R/tt_dotabulation.R
Original file line number Diff line number Diff line change
Expand Up @@ -1375,20 +1375,12 @@ setMethod("set_def_child_ord", "VarLevWBaselineSplit",
levels(vec)
else
unique(vec)

if(is.factor(vals)) {
## this sorts the levels
vals <- levels(relevel(droplevels(vals), bline))
}
}
if (!bline %in% vals) {
stop(paste0(
'Reference group "', bline, '"', ' was not present in the levels of ', spl_payload(lyt), ' in the data.'
))
}
pos <- match(bline, vals)
## same order except ref_group always first
vals <- c(bline, vals[-pos])
spl_child_order(lyt) <- vals
lyt
})
Expand Down

0 comments on commit 2573465

Please sign in to comment.