partition (version 0.1.0)

mapping_key: Return partition mapping key

Description

mapping_key() returns a data frame with each reduced variable and its mapping and information loss; the mapping and indices are represented as list-cols (so there is one row per variable in the reduced data set). unnest_mappings() unnests the list columns to return a tidy data frame. mapping_groups() returns a list of mappings (either the variable names or their column position).

Usage

mapping_key(.partition)

unnest_mappings(.partition)

mapping_groups(.partition, indices = FALSE)

Arguments

.partition

a partition object

indices

logical. Return just the indices instead of the names? Default is FALSE.

Value

a tibble

Examples

Run this code
# NOT RUN {
set.seed(123)
df <- simulate_block_data(c(3, 4, 5), lower_corr = .4, upper_corr = .6, n = 100)
# fit partition
prt <- partition(df, threshold = .6)

# tibble: 6 x 4
mapping_key(prt)

# tibble: 12 x 4
unnest_mappings(prt)

# list: length 6
mapping_groups(prt)

# }

Run the code above in your browser using DataLab