View source: R/lmwLoading2dPlot.R
lmwLoading2dPlot | R Documentation |
Draws the Loading plots of each effect matrix provided in lmwPcaEffects
outputs. As a wrapper of the plotScatter
function, it allows the visualization of effect loading matrices for two components at a time with all options available in plotScatter
.
lmwLoading2dPlot( resLmwPcaEffects, effectNames = NULL, axes = c(1, 2), metadata = NULL, ... )
resLmwPcaEffects |
A list corresponding to the output value of |
effectNames |
Names of the effects to be plotted. If |
axes |
A numerical vector with the 2 Principal Components axes to be drawn. |
metadata |
A nxk "free encoded" data.frame corresponding to |
... |
Additional arguments to be passed to |
lmwLoading2dPlot
is a wrapper of plotScatter
.
A list of loading plots (ggplot).
data('UCH') resLmwModelMatrix = lmwModelMatrix(UCH) resLmwEffectMatrices = lmwEffectMatrices(resLmwModelMatrix) resASCA = lmwPcaEffects(resLmwEffectMatrices) # adding labels to points labels = substr(colnames(UCH$outcomes),1,4) ids <- order(resASCA$Hippurate$loadings[,1], decreasing = TRUE)[1:10] labels[-c(ids)] <- "" # adding (arbitrary) color and shape to points groups <- rep(c(1,2), length.out = ncol(UCH$outcomes)) metadata <- data.frame(groups) lmwLoading2dPlot(resASCA,effectNames = "Hippurate", metadata = metadata, color = "groups", shape = "groups", points_labs = labels)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.