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 (n, p) to plot. If p > 2, only the first two columns are considered.

group

Groups of observations (n) to be plotted with different colors (default to NULL).

asp

Scalar. Giving the aspect ratio y/x. The value asp = 0 is the default in plot.default (no constraints on the ratio). See plot.default.

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 adjustcolor.

zeroes

Logical indicationg if an horizontal and vertical lines are drawn at coordonates (0, 0) (Default to FALSE).

circle

Not still working. Logical indicating if a correlation circle is plotted (default to FALSE).

ellipse

Logical indicating if a Gaussian ellipse is plotted (default to FALSE). If there are groups, an ellipse is drawn for each group.

labels

Logical indicating if the row names of X (instead of points) are plotted (default to FALSE).

legend

Only if there are groups. Logical indicationg is a legend is drawn for groups (Default to FALSE).

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 plot, points, axis and text.

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")


[Package rchemo version 0.1-1 Index]