mbecPCAPlot: PCA plotting function

Description Usage Arguments Value Examples

View source: R/mbecs_plots.R

Description

Takes data.frame from mbecPCA and produces a ggplot2 object.

Usage

1
mbecPCAPlot(plot.df, metric.df, model.vars, pca.axes)

Arguments

plot.df

Data.frame containing principal component data.

metric.df

Data.frame containing covariate data.

model.vars

two covariates of interest to select by first variable selects panels and second one determines coloring.

pca.axes

NMumerical two-piece vector that selects PCs to plot.

Value

ggplot2 object

Examples

1
2
3
4
5
6
# This will return a paneled plot that shows results for the variance
# assessment.
pca.df <- mbecPCA(input.obj=dummy.mbec,
model.vars=c('group','batch'), pca.axes=c(1,2), return.data=TRUE)
plot.pca <- mbecPCAPlot(plot.df=pca.df[[1]], metric.df=pca.df[[2]],
model.vars=c('group','batch'), pca.axes=c(1,2))

buschlab/MBECS documentation built on Jan. 21, 2022, 1:27 a.m.