flatten_table_list | R Documentation |
pivot_table
object list into a flat tableGiven a list of pivot_table
objects and a transformation function that
flattens a pivot_table
object, transforms each object using the function
and merges the results into a flat table.
flatten_table_list(lpt = list(), FUN)
lpt |
A list of |
FUN |
A function, transformation function that flattens a |
A tibble
, a flat table implemented by a tibble
.
pivot_table
Other flat table list functions:
divide()
,
get_col_values()
f <- function(pt) {
pt |>
set_page(1, 1) |>
remove_top(1) |>
define_labels(n_col = 2, n_row = 2) |>
remove_k() |>
replace_dec() |>
fill_values() |>
fill_labels() |>
remove_agg() |>
unpivot()
}
pt <- pivot_table(df_set_h_v)
lpt <- pt |> divide()
ft <- flatten_table_list(lpt, f)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.