Skip to contents

Prepare Data for Plotting

Usage

prepare(
  x,
  margin,
  axes = c(1, 2),
  active = TRUE,
  sup = TRUE,
  principal = TRUE,
  highlight = NULL,
  reorder = TRUE,
  color = NULL,
  fill = NULL,
  shape = 16,
  size = c(1, 3),
  line_type = NULL,
  line_width = size,
  ...
)

Arguments

x

A MultivariateAnalysis object.

margin

A length-one numeric vector giving the subscript which the data will be returned: 1 indicates individuals/rows (the default), 2 indicates variables/columns.

axes

A length-two numeric vector giving the dimensions to be plotted.

active

A logical scalar: should the active observations be plotted?

sup

A logical scalar: should the supplementary observations be plotted?

principal

A logical scalar: should principal coordinates be returned? If FALSE, standard coordinates are returned.

highlight

A vector specifying the information to be highlighted. If NULL (the default), no highlighting is applied. If a single character string is passed, it must be the name of a categorical variable, or one of "observation", "mass", "sum", "contribution" or "cos2" (see augment()).

color

The colors for lines and points (will be mapped to highlight).

shape

A vector of plotting characters or symbols (will be mapped to highlight). This can either be a single character or an integer code for one of a set of graphics symbols.

size

A length-two numeric vector giving range of possible sizes (greater than 0; (will be mapped to highlight).

line_type, line_width

A specification for the line type and width (will be mapped to highlight).

Value

A data.frame with the following columns:

x

Coordinates along x.

y

Coordinates along y.

z

Variable to be highlighted.

label

Label.

sup

Is supplementary?

col

Color for lines and points.

bg

Background color.

pch

Symbol.

cex

Symbol size.

lty

Line type.

lwd

Line width.

Author

N. Frerebeau