R/vectorplot.R
vectorplot.Rd
Plots vectors with 0 < norms < 1 inside a circle. These plots are mainly designed to represent variables in principal components space for PCAs.
vectorplot(x, ...)
# Default S3 method
vectorplot(
x,
y,
col = par("col"),
circle.col = "gray",
ar.length = 0.1,
pos = NULL,
cex = par("cex"),
labels = NULL,
...
)
# S3 method for class 'loadings'
vectorplot(
x,
choices = 1L:2L,
col = par("col"),
circle.col = "gray",
ar.length = 0.1,
pos = NULL,
cex = par("cex"),
labels = rownames(x),
main = deparse(substitute(x)),
...
)
# S3 method for class 'Correlation'
vectorplot(
x,
choices = 1L:2L,
col = par("col"),
circle.col = "gray",
ar.length = 0.1,
pos = NULL,
cex = par("cex"),
labels = rownames(x),
main = deparse(substitute(x)),
...
)
An object that has a vectorplot()
method, like 'loadings'
or 'correlation', or a numeric vector with 0 < values < 1.
Further arguments passed to plot functions.
A numeric vector with 0 < values < 1 of same length as `x.
Color of the arrows and labels.
The color for the circle around the vector plot.
The length of the arrows.
The position of text relative to arrows. If NULL
, a suitable
position is calculated according to the direction where the arrows are
pointing.
The factor of expansion for labels in the graph.
The labels to draw near the arrows.
A vector of two integers indicating the axes to plot.
The title of the plot.
The object 'x' is returned invisibly. These functions are called for their side-effect of drawing a vector plot.
# Create a PCA and plot loadings and correlations
iris.pca <- pcomp(iris[, -5])
vectorplot(loadings(iris.pca))
vectorplot(Correlation(iris.pca))
# Note: on screen devices, change aspect ratio of the graph by resizing
# the window to reveal cropped labels...