cortable: Correlation plot and table with significance stars.

Description Usage Arguments Details Value Author(s) Examples

Description

Get a correlation plot and table with significance stars.

Usage

1
2
3
4
5
cortable(df,
        returns="both",
        correction="holm",
        type="pearson",
        iamaboringperson=FALSE)

Arguments

df

A dataframe.

returns

"table", "plot" or "both". Returns a table, a ggplot plot or a list with both.

correction

"none", "holm" for holm-bonferroni (default), "fdr" for False Discovery Rate.

type

"pearson" for Pearson's, "partial" for partial correlations and "spearman" for Spearman's.

iamaboringperson

Are you?

Details

cortable displays a correlation matrix or table, and a plot. Note that you can save the table under a .csv format to easily integrate it in your documents. Moreover, you can customize the plot's theme and featuers as it is in ggplot2's format.

Value

result

Either The table in the format of a dataframe or the plot in the format of a ggplot's plot. Depending on the "returns" argument.

Author(s)

Dominique Makowski and Bertolt

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
require(neuropsychology)

df <- personality

cortable(df)

# Extract the table
table <- cortable(df, returns="table")

# Extract the plot
plot <- cortable(df, returns="plot")

# Save table
write.csv(table, "correlation_table.csv")

# Save plot
ggplot2::ggsave("mycorrplot.png", plot)

neuropsychology/neuropsychology.R documentation built on May 23, 2019, 4:27 p.m.