plotScatter: Scatter plot of canonical variates from SCCA using PMD

View source: R/plotScatter.R

plotScatterR Documentation

Scatter plot of canonical variates from SCCA using PMD

Description

This function generates the scatter plot of canonical variates to check if there is separation pattern between groups.

Usage

plotScatter(X, Y, K, CCA_out, groups)

Arguments

X

Data matrix, each row is one sample, each column is one feature.

Y

Data matrix, each row is one sample, each column is one feature.

K

Number of pairs of canonical variates to be plotted.

CCA_out

List of SCCA results from PMA::CCA().

groups

a vector indicating the group information of samples, will be colored differently in the scatter plot.

Value

A series of scatter plot with canonical variates as axes, samples from different groups are colored differently.

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)
p_list <- plotScatter(X = covid$metabolite, Y = covid$protein,
CCA_out = out, groups = covid$meta$icu, K = 3)
ggpubr::ggarrange(plotlist = p_list, nrow = 1)

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