Closed averissimo closed 5 months ago
The following works. I think it is a matter of having at least one is_event
per split. Probably need to improve messaging though
lyt <- rtables::basic_table() |>
rtables::split_cols_by(var = "ARM") |>
tern::surv_time(
vars = "AVAL",
is_event = "is_event"
)
my_anl <- tibble::tribble(
~AVAL, ~ARM, ~is_event,
1, "B", FALSE,
2, "B", TRUE,
1, "A", FALSE,
2, "A", TRUE
)
rtables::build_table(lyt = lyt, df = my_anl)
Yup, That is the case of a real study data we are working on.
I think the solution show still generates a valid table (even if a split only has events).
So either have the same result as previous versions of tern
, or add relevant annotations on the table.
What happened?
Found a problem when creating a table with survival data where columns are split by a variable and one (or more) groups has only events.
Reproducible examples (via
rtables
, or using onlytern
)Created on 2024-06-21 with reprex v2.1.0
Some possible test to avoid this regression in the future :-)
Created on 2024-06-21 with reprex v2.1.0
Additional notes:
It works with a package manager snapshot from
2023-06-09
with these 3 versions:sessionInfo()
Relevant log output
No response
Code of Conduct
Contribution Guidelines
Security Policy