Skip to content
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

child_labels = "hidden" should not affect path #314

Closed
waddella opened this issue Apr 5, 2022 · 1 comment
Closed

child_labels = "hidden" should not affect path #314

waddella opened this issue Apr 5, 2022 · 1 comment
Labels

Comments

@waddella
Copy link
Contributor

waddella commented Apr 5, 2022

on rtables version 0.5.0 the row paths get displayed incorrect when setting child_labels = "hidden" in split_rows_by.

here is an example:

library(rtables)
library(dplyr)

df <- expand.grid(
  ARM = factor(paste("ARM", c("A", "B"))),
  FCT = factor(c("f1", "f2"))
) %>%
  mutate(val = 1:n())

df

s_test <- function(df, ...) in_rows(mn = 1, sd = 2)

lyt <- basic_table() %>%
  split_cols_by("ARM", ref_group = "ARM A") %>%
  split_rows_by("FCT", child_labels = "hidden") %>%
  analyze("val", afun = s_test)

tbl <- build_table(lyt, df)
row_paths_summary(tbl)

value_at(tbl, c("FCT", "f1", "val", "mn"), c("ARM", "ARM A"))

It should have the path as I specified in the value_at call above.

@gmbecker
Copy link
Collaborator

gmbecker commented Apr 5, 2022

Fixed in the above commit with regression test.

@gmbecker gmbecker closed this as completed Apr 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants