cor_df: Correlate Dataframe

Description Usage Arguments Value

View source: R/cor_df.R

Description

This function takes a dataframe and returns a pairwise correlation of all data within it. This includes deselecting non-numeric columns, removing constant columns and dropping NA values. The output of this function has utility in producing network graphs in conjunction with the tidygraphs and ggraph packages.

Usage

1
cor_df(df, method = "pearson")

Arguments

df

A dataframe.

method

The method to supply to the cor() function - "pearson", "spearman" or "kendall".

Value

A three-column dataframe - two columns of items and one column of correlation coefficients.


jack-davison/jdavisonmisc documentation built on Jan. 1, 2021, 4:26 a.m.