You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the below example we have a labels variable (which does not have the same alphabetic ordering as the original arm variable). This gives the wrong labeling of the columns when it is a factor. Only when it is character it works as expected. I would guess that fixing this should be simply putting as.character() in the right place?
library(rtables)
library(dplyr)
ex_adsl<-ex_adsl %>%
mutate(
ARMLAB=factor(case_when( # need to omit factor to solve problem belowARM=="A: Drug X"~"Drug X",
ARM=="B: Placebo"~"Placebo",
ARM=="C: Combination"~"Combination")
))
lyt_orig<- basic_table() %>%
split_cols_by("ARM") %>%
analyze(c("AGE", "BMRKR2"))
tbl_orig<- build_table(lyt_orig, ex_adsl)
lyt_lab<- basic_table() %>%
split_cols_by("ARM", labels_var="ARMLAB") %>%
analyze(c("AGE", "BMRKR2"))
tbl_lab<- build_table(lyt_lab, ex_adsl)
tbl_origtbl_lab# wrong labeling here
Typo in the commit message but this is fixed in 39c655e and pushed as a narrow bugfix to devel. The regression test will be added to the branch I'm currently working on for now (mostly cause I forgot to add it to the commit that got pushed directly to devel).
In the below example we have a labels variable (which does not have the same alphabetic ordering as the original arm variable). This gives the wrong labeling of the columns when it is a factor. Only when it is character it works as expected. I would guess that fixing this should be simply putting
as.character()
in the right place?Session info:
The text was updated successfully, but these errors were encountered: