corr_rm: corr_rm filter data.frame by correlation values.

View source: R/corr_rm.R

corr_rmR Documentation

corr_rm filter data.frame by correlation values.

Description

Remove highly correlated variables from a data.frame using the corrp functions outputs and the caret package function findCorrelation.

Usage

corr_rm(df, c, ...)

## S3 method for class 'clist'
corr_rm(
  df,
  c,
  col = c("infer.value", "stat.value"),
  isig = TRUE,
  cutoff = 0.75,
  ...
)

## S3 method for class 'list'
corr_rm(
  df,
  c,
  col = c("infer.value", "stat.value"),
  isig = TRUE,
  cutoff = 0.75,
  ...
)

## S3 method for class 'cmatrix'
corr_rm(df, c, cutoff = 0.75, ...)

## S3 method for class 'matrix'
corr_rm(df, c, cutoff = 0.75, ...)

Arguments

df

\[data.frame(1)]
input data frame.

c

\[clist(1) | cmatrix(1)]
correlation list output from corrp or correlation matrix output from corr_matrix.

...

Additional arguments (TODO).

col

\[character(1)]
choose the column to be used in the correlation matrix

isig

\[logical(1)]
values that are not statistically significant will be represented by NA or FALSE in the correlation matrix.

cutoff

\[numeric(1)]
A numeric value for the pair-wise absolute correlation cutoff. The default values is 0.75.

Author(s)

Igor D.S. Siciliani

Examples

## Not run: 

air_cor = corrp(airquality)
corr_rm(df=airquality,c=air_cor,cutoff=0.75,col = 'infer.value',isig = F)


## End(Not run)

meantrix/corrP documentation built on Oct. 22, 2024, 10:16 a.m.