data.cor: Calculates differential correlation statistics for all the...

Description Usage Arguments Value Author(s) Examples

View source: R/data.cor.R

Description

Creates a table of pairwise correlations statistics for all variables within a dataframe, with separation of two groups for comparison. This can be used as an exploratory tool to investigate differential correlations within a dataset. Requires grouping variable to compare two groups.

Usage

1
data.cor(data, group, ordered = "fisher", limit = NA)

Arguments

data

dataframe for analysis

group

character string defining the grouping variable for comparative differential correlations

ordered

character string defining the variable to order output by. Choose from g1cor, g1p, g2cor, g2r, fisher (default) and BH.

limit

numeric input to limit number of output correlation pairings

Value

a table (or dataframe) with correlation coefficients, p-values, fisher r-to-z p-value and adjusted p-value using Benjamini-Hochberg corretion for each correlation pair, with separation of two groups for comparison.

Author(s)

Emily Mears, mears.emilyrose@gmail.com, Matthew Grant, mgra576@aucklanduni.ac.nz

Ben Day, benjamindayengineer@gmail.com

Examples

1
2
3
4
5
6
## Load example dataframes
df <- read.csv("example_data/excorr_df2.csv")

## Run function
data.cor(df, group = "sex")
data.cor(df, group = "sex", ordered = "fisher", limit = 20)

emily5/exCorr documentation built on May 22, 2020, 1:01 p.m.