Skip to content

Commit

Permalink
[skip style] [skip vbump] Restyle files
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Dec 4, 2024
1 parent 137b19b commit 7187c7e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions R/tt_as_df.R
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,13 @@ as_result_df <- function(tt, spec = NULL,
which_root_name = c("root", "rbind_root"),
all = TRUE
)
# Correcting maxlen for even number of paths (only multianalysis diff table names)

# Correcting maxlen for even number of paths (only multianalysis diff table names)
maxlen <- max(lengths(df$path))
if (maxlen %% 2 != 0) {
maxlen <- maxlen + 1
}

# Loop for metadata (path and details from make_row_df)
metadf <- do.call(
rbind.data.frame,
Expand Down Expand Up @@ -330,7 +330,7 @@ as_result_df <- function(tt, spec = NULL,
kids <- tree_children(ci_coltree)
return(lapply(kids, .get_column_split_name))
}

lapply(pos_splits(tree_pos(ci_coltree)), function(x) {
pl <- spl_payload(x)
if (!is.null(pl)) { # it is null when all obs (1 column)
Expand Down
6 changes: 3 additions & 3 deletions tests/testthat/test-result_data_frame.R
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,10 @@ test_that("as_result_df works fine with empty tables and no character(0) is allo

test_that("as_result_df works with only analyze tables (odd num of path elements)", {
tbl <- basic_table() %>%
analyze("cyl", table_names = "a") %>%
analyze("mpg") %>%
analyze("cyl", table_names = "a") %>%
analyze("mpg") %>%
build_table(mtcars)

expect_equal(as_result_df(tbl)$group1[[1]], "<analysis_spl_tbl_name>")
expect_equal(as_result_df(tbl, make_ard = TRUE)$group1[[1]], "<analysis_spl_tbl_name>")
})
Expand Down

0 comments on commit 7187c7e

Please sign in to comment.