cor_net: Correlation network analysis

View source: R/mt_extra.R

cor_netR Documentation

Correlation network analysis

Description

Perform network analysis for correlation coefficient.

Usage

cor_net(
  mat,
  use = "pairwise.complete.obs",
  method = "pearson",
  thres = 0.6,
  fig_title = "Correlation network"
)

Arguments

mat

a data matrix for correlation analysis

use, method

parameters of stats::cor().

thres

correlation coefficient threshold for network analysis. Only keep those with coefficient larger than thres.

fig_title

a character string for figure title.

Value

a list of ggplot2 plots.

Examples

res <- cor_net(mtcars)
names(res)
res$p1    # or res$p2, res$p3, res$p4
## Not run: 
## see https://ggplot2-book.org/arranging-plots.html
library(patchwork)
res$p1 + res$p2 + res$p3 + res$p4 

## End(Not run)

wanchanglin/mtExtra documentation built on Aug. 2, 2024, 5:47 p.m.