Closed kinto-b closed 4 years ago
The output of set_table() should always contain rows and row_spanner columns.
set_table()
rows
row_spanner
We shouldn't have to specify what to do with these. Thus, we shouldn't have to write
set_table( mtcars, .rows = list(Cylinders = cyl), # row_spanner -> "cyl" and rows -> "cyl %in% 4", ... .cols = list( vshaped = encol_freq(vs %in% 1, mtcars$vs %in% 1), non_vshaped = encol_freq(vs %in% 0, mtcars$vs %in% 1) ) ) %>% project_table( list( rows = "identity", #<<<<<<<<<<<<<< Remove this row_spanner = "identity", #<<<<<<<<<<<< Remove this vshaped = "proportion" ) )
Additionally, the function signature should be project_table <- function(.data, ...) , and the ... should take glue-style specifications, like this:
project_table <- function(.data, ...)
...
project_table(.data = my_proj, some_col = "{proportion} ({little_n})" # "some_col" without a spanner, other_col = c(Proportion = "{proportion}", Count = "{sample}", CI = "{ci_lower} - {ci_upper}"), # "Proportion", "Count" and "CI" spanned by "other_col" )
The output of
set_table()
should always containrows
androw_spanner
columns.We shouldn't have to specify what to do with these. Thus, we shouldn't have to write
Additionally, the function signature should be
project_table <- function(.data, ...)
, and the...
should take glue-style specifications, like this: