filter_reduced()
and unnest_reduced()
are convenience functions to
quickly retrieve the mappings for only the reduced variables.
filter_reduced()
returns a nested tibble
while unnest_reduced()
unnests
it.
filter_reduced(.partition)
unnest_reduced(.partition)
a tibble
with mapping key
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)
# A tibble: 3 x 4
filter_reduced(prt)
#> # A tibble: 2 × 4
#> variable mapping information indices
#> <chr> <list> <dbl> <list>
#> 1 reduced_var_1 <chr [2]> 0.656 <int [2]>
#> 2 reduced_var_2 <chr [3]> 0.627 <int [3]>
# A tibble: 9 x 4
unnest_reduced(prt)
#> # A tibble: 5 × 4
#> variable mapping information indices
#> <chr> <chr> <dbl> <int>
#> 1 reduced_var_1 block3_x1 0.656 8
#> 2 reduced_var_1 block3_x5 0.656 12
#> 3 reduced_var_2 block2_x1 0.627 4
#> 4 reduced_var_2 block2_x2 0.627 5
#> 5 reduced_var_2 block2_x3 0.627 6