Learn R Programming

MBAnalysis (version 2.1.1)

MBplotScores: Customizable Plots of Scores

Description

Plots scores related information of MBPCA, ComDim, MBPLS or MBWCov with several options of customization.

Usage

MBplotScores(
  res,
  axes = c(1, 2),
  block = 0,
  color = NULL,
  select = 1:nrow(res$Scor.g),
  title = NULL,
  size = 2.25
)

Value

The required plot.

Arguments

res

An object resulting from MBPCA, ComDim, MBPLS or MBWCov.

axes

Which dimensions should be plotted?

block

Of which block? Block 0 corresponds to global components.

color

Either NULL (default) or a character vector of length select. Controls the color of each individual plotted. Useful if individuals pertain to different a priori known groups. By default individuals are colored in black for global components and in the block color (the same as in MBplotVars) for block components.

select

A numeric or integer vector to select which individuals should be plotted. By default, all individuals are plotted.

title

An optional title to be added to the plot.

size

The overall size of labels, points, etc.

See Also

plot.MBPCA plot.ComDim plot.MBPLS plot.MBWCov

Examples

Run this code
# Unsupervised example

data(ham)
X=ham$X
block=ham$block
res.mbpca <- MBPCA(X,block, name.block=names(block))
MBplotScores(res.mbpca)

# Supervised example

data(ham)
X=ham$X
block=ham$block
Y=ham$Y
res.mbpls <- MBPLS(X, Y, block, name.block=names(block))
MBplotScores(res.mbpls)

Run the code above in your browser using DataLab