pcapairs_bymoose: pca pairs plot

View source: R/pcapairs_bymoose.R

pcapairs_bymooseR Documentation

pca pairs plot

Description

This function generates an upper triangle PCA plot for all pairs of PC loadings provided.

Usage

pcapairs_bymoose(myloadings, varexp, pcol = "dodgerblue")

Arguments

myloadings

a matrix or data frame of PC loadings (only those you would like to plot).

varexp

a vector of the the variance explained by each PC

pcol

plot colors for the dots background

Value

a base R plot

Examples

ex_data = sapply(1:5, function(x){rnorm( 50, 0, 2) })
## add in some extreme values to a sample
ex_data[1,] = ex_data[1,] + sample( c(8, -8), ncol(ex_data), replace = TRUE )
ex_data[2,] = ex_data[2,] + sample( c(3, -3), ncol(ex_data), replace = TRUE )
## plot
pcapairs_bymoose(myloadings = ex_data, 
    varexp = rep(1/ncol(ex_data), ncol(ex_data)),
    pcol = "tomato" )


MRCIEU/metaboprep documentation built on Jan. 28, 2023, 7:29 p.m.