plotBar: Bar plot of canonical loadings from SCCA using PMD

View source: R/plotBar.R

plotBarR Documentation

Bar plot of canonical loadings from SCCA using PMD

Description

This function generates the bar plot of canonical loadings.

Usage

plotBar(data, loadings, qvalues, feature_groups = NULL, alpha = 0.05)

Arguments

data

Data matrix corresponding to the canonical loadings, samples are in rows, variables are in columns.

loadings

A named vector containing the estimated loadings.

qvalues

A vector containing qvalues for the canonical loadings.

feature_groups

A vector indicating the group information of variables.

alpha

Significance level, 0.05 by default.

Value

A bar plot of canonical loadings, colored by significance, if group is not NULL, background is colored by group.

Examples

library(TestPMD)
data("covid")
out <- PMA::CCA(standsdmu(covid$metabolite), standsdmu(covid$protein),
typex = "standard", typez="standard",
penaltyx = 0.9, penaltyz = 0.9, K = 3, standardize = FALSE, trace = FALSE)
pvalue <- CPTloading(X = covid$metabolite, Y = covid$protein, side = "X", K = 1, r = 10,
penalty = "Fixed", rho_x = 0.9, rho_y = 0.9, permutation_no = 100)
p_bar <- plotBar(data = covid$metabolite, loadings = out$u[,1], qvalues = pvalue,
feature_groups = NULL, alpha = 0.1)
p_bar

YunhuiQi/TestPMD documentation built on May 5, 2022, 8:23 p.m.