-
-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question]: summarize_vars_in_cols no longer exists #931
Comments
We had to change its name and behavior because it was not paginating correctly. You can find the renaming commit here . It is virtually the same with the difference that it uses In practice for you, it is enough to change the name of the function into ps: the renaming should be in the news file, I do not know if it was correctly propagated afterward. |
Thanks @Melkiades . From what I am seeing, this works so far so good.
However, I was trying to first get overall statistics and then split rows by two variables to get the same statistics. See the below example where I am just splitting by one variable.
I tried with the
|
I think what you ask for makes sense to implement again. We do not have currently any need for this mixed behavior but we should support it. I am working on it ;) |
@imazubi now you can do it with something like the following. Note that the switcher between summarize and analyze is a flat called # More nesting
lyt <- basic_table() %>%
split_rows_by("SEX") %>%
analyze_vars_in_cols(
vars = "AGE",
do_summarize_row_groups = TRUE
) %>%
split_rows_by("RACE", child_labels = "hidden", split_fun = drop_split_levels) %>%
analyze_vars_in_cols(
vars = "AGE",
split_col_vars = FALSE,
do_summarize_row_groups = TRUE
) %>%
split_rows_by("ARM", child_labels = "hidden", split_fun = drop_split_levels) %>%
analyze_vars_in_cols(
vars = "AGE",
split_col_vars = FALSE,
do_summarize_row_groups = TRUE
) %>%
split_rows_by("STRATA1", child_labels = "hidden", split_fun = drop_split_levels) %>%
analyze_vars_in_cols(
vars = "AGE",
split_col_vars = FALSE
)
tbl <- testthat::expect_silent(build_table(lyt, df = tern_ex_adpp))
# Again sorting works
tbl_sorted <- sort_at_path(tbl, c("SEX", "*", "RACE"), cont_n_onecol(1))
tbl_sorted <- sort_at_path(tbl_sorted, c("SEX", "*", "RACE", "*", "ARM", "*", "STRATA1"), scorefun(1)) |
What is your question?
Hi Nest folks,
In older versions (< 0.8.0) of tern I was using
summarize_vars_in_cols
but I just saw in the later versions this function is no longer an exported object (breaking change for me). Is there any alternative so that we can summarize the statistics in columns?This was the file
Thanks,
IZ
Code of Conduct
Contribution Guidelines
Security Policy
The text was updated successfully, but these errors were encountered: