only_joint: Keeps only joint distribution (removes '.total').

Description Usage Arguments Value Examples

View source: R/distrr_funs.R

Description

Removes all the rows where variables have value .total.

Usage

1
only_joint(.cube, .total = "Totale", .variables = NULL)

Arguments

.cube

a datacube with 'Totale' modalities

.total

modality to eliminate (filter out) (default: "Totale")

.variables

a character vector with the names of the categorical variables

Value

a subset of the data cube with only the combinations of all variables modalities, without the "margins".

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
data(invented_wages)
str(invented_wages)

vars <- c("gender", "education")
tmp <- dcc2(.data = invented_wages, 
            .variables = vars, 
            .fun = jointfun_, 
            order_type = extract_unique2)
tmp
str(tmp)
only_joint(tmp, .variables = vars)

# Compare dimensions (number of groups)
dim(tmp)
dim(only_joint(tmp, .variables = vars))

distrr documentation built on July 14, 2020, 5:06 p.m.