corr_table: Create a formatted correlation table

Description Usage Arguments Value

Description

Create a formatted correlation table

Usage

1
2
3
corr_table(data, sample_size = T, use = "pairwise",
  method = "pearson", stats = NULL, c.names = names(data),
  change = F, numbered = F, flagged = T)

Arguments

data

a data.frame containing only the variable to be included in the table

sample_size

logical. TRUE will add the sample size used in each pairwise correlation and display them in the upper triangle of the table. FALSE will leave the upper triangle empty

use

a string, same as the arguemnt used in psych::corr.table. Indicates how to calculate correlations with missing data. Defualt is "pairwise".

method

a string, same as the argument in psych::corr.table. Indicates the type of correlation coefficient to compute. Default is "pearson"

stats

defaults to NULL and does not include any descriptive statistics. Otherwise should be a vector of strings naming the stats that psych::describe outputs and will be displayed below the correlation matrix

c.names

a character vector of user-provided names for the names of the variables in the table.

change

logical, indicates if you would like to change the column names of the table to c.names

numbered

logical, indicates if you would like to use numbers for the column names

flagged

logical, indicates if you would like to flag significant (p <. 05) correlations in the table

Value

a data.frame containing the correlation matrix and descriptive statistics


ethan-young/esyr documentation built on May 15, 2019, 12:45 p.m.