knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
library(cuber) str(invented_wages)
First create a list of function calls (with formulas) and a vector with names of the desired variables
fun <- list( m1 = ~weighted.mean(wage, sample_weights), s = ~sum(sample_weights) ) vars <- c("gender")
Then create the data cube, with the estimates of all the combinations of variables:
cube_df_(invented_wages, .vars = vars, fun_list = fun)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.