Skip to contents

Select a set of variables from a correlation matrix to keep as the columns, and exclude these or all other variables from the rows.

Usage

corr_focus(model, ...)

Arguments

model

A model computed with corr_coef() or a symmetric matrix, often produced with stats::cor().

...

One or more unquoted variable name separated by commas. Variable names can be used as if they were positions in the data frame, so expressions like x:y can be used to select a range of variables.

Value

A tibble

Examples

corr_coef(data_ge2) |> corr_focus(PH)
#> # A tibble: 14 × 2
#>    var        PH
#>    <chr>   <dbl>
#>  1 EH     0.932 
#>  2 EP     0.638 
#>  3 EL     0.380 
#>  4 ED     0.661 
#>  5 CL     0.325 
#>  6 CD     0.315 
#>  7 CW     0.505 
#>  8 KW     0.753 
#>  9 NR     0.329 
#> 10 NKR    0.353 
#> 11 CDED  -0.192 
#> 12 PERK   0.0408
#> 13 TKW    0.569 
#> 14 NKE    0.458