PomaCorr: Correlation Analysis

Description Usage Arguments Value Author(s) References Examples

View source: R/PomaCorr.R

Description

This function returns different correlation plots (correlogram and network plots) and a table with all pairwise correlations in the data.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
PomaCorr(
  data,
  method = "pearson",
  shape = "square",
  type = "full",
  show_corr = FALSE,
  low = "#336B87",
  outline = "white",
  high = "#EA8620",
  label_size = 12,
  corr_type = "cor",
  coeff = 0.7
)

Arguments

data

A MSnSet object. First pData column must be the subject group/type.

method

Character indicating which correlation coefficient has to be computed. Options are "pearson" (default), "kendall" and "spearman".

shape

Character ingicating shape of correlogram. Options are "square" (default) and "circle".

type

Character indicating type of correlogram. Options are "full" (default), "lower" or "upper".

show_corr

Logical indicating if correlation coefficient for each pair of features should be plotted in correlogram or not (default = FALSE). Only recomended for a low number of features.

low

Colour for low end of the gradient in correlogram.

outline

Colour for the outline of the gradient in correlogram.

high

Colour for high end of the gradient in correlogram.

label_size

Numeric indicating label size in correlogram.

corr_type

Type of network to be made with correlation matrix. Options are "cor" (for global correlations) and "glasso" (for gaussian graphical model). Default is "cor". See glasso R package for the second option.

coeff

Numeric indicatin correlation coefficient. Edges with absolute weight below this value will be removed from the network. If "corr_type" is set to "glasso", this parameter indicates the regularization parameter for lasso (rho = 0 means no regularization). See glasso::glasso().

Value

A list with the results.

Author(s)

Pol Castellano-Escuder

References

Jerome Friedman, Trevor Hastie and Rob Tibshirani (2019). glasso: Graphical Lasso: Estimation of Gaussian Graphical Models. R package version 1.11. https://CRAN.R-project.org/package=glasso

Examples

1
2
3
4
5
6
7
8
9
data("st000284")

# pearson correlation
PomaCorr(st000284)$correlations
PomaCorr(st000284)$corrplot

# gaussian graphical model
# library(ggraph)
# PomaCorr(st000284, corr_type = "glasso")

POMA documentation built on Nov. 8, 2020, 6:26 p.m.