Description Usage Arguments Value Examples
Data cube creation (dcc)
1 2 3 4 5 6 7 8 9 10 11 12 13 |
.data |
data frame to be processed |
.variables |
variables to split data frame by, as a character vector
( |
.fun |
function to apply to each piece (default: |
... |
additional functions passed to |
order_type |
a function like |
.total |
character string with the name to give to the subset of data
that includes all the observations of a variable (default: |
.all |
logical, indicating if functions' have to be evaluated on the complete dataset. |
a data cube, with a column for each cateogorical variable used, and a row for each combination of all the categorical variables' modalities. In addition to all the modalities, each variable will also have a "Total" possibility, which includes all the others. The data cube will contain marginal, conditional and joint empirical distributions...
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | data("invented_wages")
str(invented_wages)
tmp <- dcc(.data = invented_wages,
.variables = c("gender", "sector"), .fun = jointfun_)
tmp
str(tmp)
tmp2 <- dcc2(.data = invented_wages,
.variables = c("gender", "education"),
.fun = jointfun_,
order_type = extract_unique2)
tmp2
str(tmp2)
# dcc5 works like dcc2, but has an additional optional argument, .total,
# that can be added to give a name to the groups that include all the
# observations of a variable.
tmp5 <- dcc5(.data = invented_wages,
.variables = c("gender", "education"),
.fun = jointfun_,
.total = "TOTAL",
order_type = extract_unique2)
tmp5
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.