Put factor analysis tables to a model rack
Source:R/make_factor_analysis.R
rack_put_factor_analysis.RdGiven a model rack, fit factor analysis models using
shelf_make_factor_analysis_model(), put models to the column called
"factor_analysis_model_{factors}" and put results to columns called
"factor_analysis_feature_{factors}" and
"factor_analysis_segment_{factors}" using
shelf_make_factor_analysis_feature() and
shelf_make_factor_analysis_segment(). Note that factor analysis models
rely solely on the model data (the data column of a rack) and not on the
segmentation model (the model column). Of the two factor analysis summary
types only the by-segment summary depends on segmentation.
Examples
library(dplyr)
library(tidyr)
rack_put_factor_analysis(example_seg_rack, factors = 4)
#> # A tibble: 3 × 11
#> model_name n_seg seed model data segments consensus
#> <fct> <dbl> <int> <named list> <list> <list> <named list>
#> 1 nmf_3 3 1 <NMFfitX1[,54,3]> <tibble> <fct [100]> <matrix[…]>
#> 2 nmf_4 4 1 <NMFfitX1[,54,4]> <tibble> <fct [100]> <matrix[…]>
#> 3 nmf_5 5 1 <NMFfitX1[,54,5]> <tibble> <fct [100]> <matrix[…]>
#> # ℹ 4 more variables: measures <tibble[,14]>, factor_analysis_model_4 <list>,
#> # factor_analysis_feature_4 <list>, factor_analysis_segment_4 <list>