Data cube creation
data frame to be processed.
variables to split data frame by, as a character vector
(c("var1", "var2")
).
a list of function calls in the form of right-hand formula.
character string with the name to give to the subset of data
that includes all the observations of a variable (default: "Totale"
).
a function like extract_unique
or
extract_unique2
.
logical, indicating if functions have to be evaluated on the complete dataset.
name of the variable for which you do not want to estimate the total
dcc6(invented_wages,
.variables = c("gender", "sector"),
.funs_list = list(n = ~dplyr::n()),
.all = TRUE)
#>
|
| | 0%
|
|=================================== | 50%
|
|======================================================================| 100%
#> # A tibble: 9 × 3
#> gender sector n
#> * <fct> <fct> <int>
#> 1 Totale Totale 1000
#> 2 Totale secondary 455
#> 3 Totale tertiary 545
#> 4 men Totale 547
#> 5 men secondary 289
#> 6 men tertiary 258
#> 7 women Totale 453
#> 8 women secondary 166
#> 9 women tertiary 287
dcc6(invented_wages,
.variables = c("gender", "sector"),
.funs_list = list(n = ~dplyr::n()),
.all = FALSE)
#>
|
| | 0%
|
|=================================== | 50%
|
|======================================================================| 100%
#> # A tibble: 8 × 3
#> gender sector n
#> <fct> <fct> <int>
#> 1 Totale secondary 455
#> 2 Totale tertiary 545
#> 3 men Totale 547
#> 4 men secondary 289
#> 5 men tertiary 258
#> 6 women Totale 453
#> 7 women secondary 166
#> 8 women tertiary 287