
Reduce the number of variables to prepare for clustering
Source:R/scale_reduce_vars.R
scale_reduce_vars.Rd
Reduce the number of variables to prepare for clustering
Arguments
- df
A data frame containing the variables to be reduced. It should contain the following columns:
vviq
: VVIQ scoresosivq_o
: OSIVQ Object scoresosivq_s
: OSIVQ Spatial scoresosivq_v
: OSIVQ Verbal scorespsiq_vis
: Psi-Q Visual scorespsiq_aud
: Psi-Q Auditory scorespsiq_od
: Psi-Q Olfactory scorespsiq_gout
: Psi-Q Gustatory scorespsiq_tou
: Psi-Q Tactile scorespsiq_sens
: Psi-Q Sensory scorespsiq_feel
: Psi-Q Feelings scoresscore_raven
: Raven Matrices scoresscore_sri
: SRI scoresspan_spatial
: Spatial Span scoresspan_digit
: Digit Span scoreswcst_accuracy
: WCST accuracy scoresscore_similarities
: Similarities scoresscore_comprehension
: Comprehension scores
- min
Numeric. The minimum value of the scaled range. Default is 0.
- max
Numeric. The maximum value of the scaled range. Default is 1.
Value
A data frame with reduced variables, including:
visual_imagery
: Merged VVIQ, OSIVQ Object, and Psi-Q Visual scoresauditory_imagery
: Psi-Q Auditory scoressensory_imagery
: Merged Psi-Q scores on other modalitiesspatial_imagery
: Merged SRI and OSIVQ Spatial scoresverbal_strategies
: OSIVQ Verbal scoresfluid_intelligence
: Merged Raven and Digit Span scoresverbal_reasoning
: Similarities scoresspan_spatial
: Spatial Span scores
Examples
df_reduced <- scale_reduce_vars(study_data)
head(df_reduced)
#> # A tibble: 6 × 8
#> visual_imagery auditory_imagery sensory_imagery spatial_imagery
#> <dbl> <dbl> <dbl> <dbl>
#> 1 0.65 0.741 0.785 0.767
#> 2 0.617 0.889 0.771 0.745
#> 3 0.471 0.703 0.637 0.661
#> 4 0.713 0.814 0.778 0.444
#> 5 0.125 0 0 0.439
#> 6 0.703 0.778 0.578 0.761
#> # ℹ 4 more variables: verbal_strategies <dbl>, fluid_intelligence <dbl>,
#> # verbal_reasoning <dbl>, span_spatial <dbl>
colnames(df_reduced)
#> [1] "visual_imagery" "auditory_imagery" "sensory_imagery"
#> [4] "spatial_imagery" "verbal_strategies" "fluid_intelligence"
#> [7] "verbal_reasoning" "span_spatial"