plot_correlation: plot_correlation

Description Usage Arguments

Description

plot_correlation can plot correlation using a correlation table.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
plot_correlation(
  cor_tab,
  x = NA,
  y = NA,
  method = "spearman",
  histogram = FALSE,
  heatmap = FALSE,
  range = c(-1, 0, 1),
  range_color = c("blue", "white", "red"),
  row_order = NULL,
  col_order = NULL,
  row_title = NA,
  col_title = NA,
  font_size = 12
)

Arguments

cor_tab

A data frame that contains at least two columns to calculate correlation. Columns are different samples. Doesn't require rownames.

x

Colname of cor_tab. If x's length is more than 1, plot_correlation will calculate correlation respectively and facet the plot by x.

y

Colname of cor_tab.

method

A character string indicating which correlation coefficient is to be used. One of c("pearson", "kendall", or "spearman"), default is "spearman".

histogram

Add histogram to the plot. Default is FALSE.

heatmap

Dafault FASLE. If TRUE, will generate a correlation heatmap with input table. Doesn't require x or y.

range

A vector indicating numeric breaks, which will be pass to circlize::colorRamp2( breaks), default is c(-1, 0, 1).

range_color

A vector of colors which correspond to values in breaks, which will be pass to circlize::colorRamp2(colors), default is c("blue", "white", "red").

row_order

Default NULL. Input a vector of ordered rownames if need to adjust row order for heatmap. Manually setting row order will turn off clustering.

col_order

Default NULL. Input a vector of ordered colnames if need to adjust column order for heatmap. Manually setting column order will turn off clustering.

row_title

Same as ComplexHeatmap::Heatmap(row_title).

col_title

Same as ComplexHeatmap::Heatmap(column_title).

font_size

Default 12. Font size of the number in heatmap.


yeguanhuav/visual16S documentation built on Feb. 19, 2022, 10:32 a.m.