plot_corrplotgg: Creates correlation plot using ggplot2 package

plot_corrplotggR Documentation

Creates correlation plot using ggplot2 package

Description

Creates correlation plot using ggplot2 package

Usage

plot_corrplotgg(
  mat,
  xlab = "",
  ylab = "",
  labels = "",
  corr_method = c("pairwise.complete.obs", "spearman"),
  pval_color = "white",
  grid.fill.color = "white",
  grid.line.color = "black",
  pval.label = "p.signif",
  circ_max = NULL,
  star_size = NULL,
  gradient_palette = "RdBu",
  font_size = 15,
  line_size = 1,
  out_dir = ".",
  save.to.file = F
)

Arguments

mat

Numeric dataframe or matrix, where columns will be correlated. Must not contain any NAs; use complete.cases(mat) to remove rows with NAs.

xlab

X axis label.

ylab

Y axis label.

labels

A character vector of at least length 1 that will be collapsed for file name/plot titles.

corr_method

A character vector of 2 that correspond to "use" and "method" parameters in cor. The first defaults to "pairwise.complete.obs" and second is one of "pearson","spearman","kendall".

pval_color

The color of the significance stars or p-value text.

grid.fill.color

The color for grid fill.

grid.line.color

The color for grid line.

pval.label

How p-values are represented. Allowed values are "p.signif" (stars) and "p.format" (number).

circ_max

The maximum size of circle within cells in grid.

star_size

The size of star labels on correlation plots.

gradient_palette

RColorBrewer palette. See display.brewer.all for all options.

font_size

The size of text labels on correlation plots. legend title. The size of legend text and plot title is font_size / 1.5. The size of legend text and plot subtitle is font_size / 3.

line_size

The thickness of grid lines.

out_dir

The output directory where the plot will be saved when save.to.file is TRUE, default is current working directory.

save.to.file

If TRUE, save plot to file in out_dir. If FALSE, print to panel.

Value

Plot object if save.to.file is FALSE.

See Also

Other plotting: plot_corrplot(), plot_discrete_barplot(), plot_heatmap(), plot_het_barplot(), plot_indiv_boxplot(), plot_indiv_corrscatt(), plot_indiv_paired(), plot_overview_boxplot(), plot_overview_corr_scatt(), plot_profile_barplot(), run_corrplot_analysis()


kazeera/hourglass documentation built on April 5, 2025, 7:18 a.m.