plotxy {rchemo} | R Documentation |
2-d scatter plot
Description
2-dimension scatter plot.
Usage
plotxy(X, group = NULL,
asp = 0, col = NULL, alpha.f = .8,
zeroes = FALSE, circle = FALSE, ellipse = FALSE,
labels = FALSE,
legend = TRUE, legend.title = NULL, ncol = 1,
...)
Arguments
X |
Data ( |
group |
Groups of observations ( |
asp |
Scalar. Giving the aspect ratio y/x. The value |
col |
A color, or a vector of colors (of length equal to the number of groups), defining the color(s) of the groups. |
alpha.f |
Scalar modifying the opacity of the points in the graphics; typically in [0,1]. See |
zeroes |
Logical indicationg if an horizontal and vertical lines are drawn at coordonates (0, 0) (Default to |
circle |
Not still working. Logical indicating if a correlation circle is plotted (default to |
ellipse |
Logical indicating if a Gaussian ellipse is plotted (default to |
labels |
Logical indicating if the row names of |
legend |
Only if there are groups. Logical indicationg is a legend is drawn for groups (Default to |
legend.title |
Character string indicationg a title for the legend. |
ncol |
Number of columns drawn in the legend box. |
... |
Other arguments to pass in functions |
Value
A plot.
Examples
n <- 50 ; p <- 10
Xtrain <- matrix(rnorm(n * p), ncol = p)
Xtest <- Xtrain[1:5, ] + .4
fm <- pcaeigen(Xtrain, nlv = 5)
Ttrain <- fm$T
Ttest <- transform(fm, Xtest)
T <- rbind(Ttrain, Ttest)
group <- c(rep("Training", nrow(Ttrain)), rep("Test", nrow(Ttest)))
i <- 1
plotxy(T[, i:(i+1)], group = group,
pch = 16, zeroes = TRUE,
main = "PCA")
plotxy(T[, i:(i+1)], group = group,
pch = 16, zeroes = TRUE, asp = 1,
main = "PCA")