pivotr <- function(data,
rows = NULL,
cols = NULL,
value = NULL,
wt = NULL,
fun = NULL,
filter = TRUE,
prop = FALSE,
percent = FALSE,
round = NULL,
within = NULL,
pivot = TRUE
){
data |>
data_filter({{filter}}) |>
data_define_value(value = {{value}}, wt = {{wt}}) |>
data_to_grouped(rows = {{rows}}, cols = {{cols}}) |>
data_grouped_to_summarized(fun = fun) |>
data_summarized_to_proportioned(prop = prop, percent = percent, within = {{within}}, round = round) |>
data_proportioned_to_pivoted(pivot = pivot, cols = {{cols}})
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.