Set the default agregation for an R session

pivot_default_values(...)

Arguments

...

Variables or calculation to aggregate by

Details

It records the named quotation variables into via the options() command, inside the "pivotable_default_values" option.

Examples

pivot_default_values(n()) retail_orders %>% pivot_rows(status)
#> n() #> Cancelled 4 #> Disputed 3 #> In Process 6 #> On Hold 4 #> Resolved 4 #> Shipped 286 #> Total 307
pivot_default_values(sum(sales)) retail_orders %>% pivot_rows(status)
#> sum(sales) #> Cancelled 194487.48 #> Disputed 72212.86 #> In Process 144729.96 #> On Hold 178979.19 #> Resolved 150718.28 #> Shipped 9291501.08 #> Total 10032628.85