cordf: Correlations above a threshold

Description Usage Arguments Details Value See Also

View source: R/utils.r

Description

This function returns a dataframe with the variable pairs above a given correlation threshold

Usage

1
2
3
4
5
6
7
cordf(
  data,
  vars = NULL,
  threshold = 0.6,
  use = "everything",
  method = c("pearson", "kendall", "spearman")
)

Arguments

data

dataframe with the data

vars

vector of column names or column numbers holding the variables to analyse. If not specified all the columns will be used.

threshold

correlation threshold

use

an optional character string giving a method for computing covariances in the presence of missing values. This must be (an abbreviation of) one of the strings "everything", "all.obs", "complete.obs", "na.or.complete", or "pairwise.complete.obs"

method

a character string indicating which correlation coefficient is to be computed. One of "pearson" (default), "kendall", or "spearman", can be abbreviated

Details

It is based on the cor function, but instead of a correlation matrix it returns a dataframe with the pairwise combinations above a threshold.

Value

a dataframe holding the variable pairs with a correlation higher than the specified threshold

See Also

cor2df


pezzacolori/boris-r-misc documentation built on Sept. 14, 2021, 1:46 a.m.