ellipsescatter {LSD} | R Documentation |
Visualize subgroups of two-dimensional data assuming normal distributions
Description
A scatterplot with additional colored ellipses based on a gaussianity assumption.
Usage
ellipsescatter(
x,
y,
groups,
colors = NULL,
pch = 20,
bgcol = "darkgrey",
main = "ellipsescatter",
xlab = NULL,
ylab = NULL,
scalesd = 1,
level = 0.75,
legend.cex = 1,
location = "topright",
...
)
Arguments
x |
a numeric vector. |
y |
a numeric vector. |
groups |
a list of indices or vector names to be plotted as groups (not necessarily all of x and y). |
colors |
a character vector of R build-in colors corresponding to the chosen groups. |
pch |
the plotting character (to be passed to plot). |
bgcol |
a R build-in color for non-grouped points. |
main |
title(s) of the plot, standard graphics parameter. |
xlab |
x label, standard graphics parameter. |
ylab |
y label, standard graphics parameter. |
scalesd |
a numeric value giving the scaling factor for standard deviations in each dimension (defaults to 1). |
level |
a numeric value (between 0 and 1) giving the confidence level of a pairwise confidence region. |
legend.cex |
a numerical value giving the amount by which the added legend should be magnified relative to the default. |
location |
the x and y co-ordinates to be used to position the legend (see 'xy.coords'). |
... |
additional parameters to be passed to points and plot. |
Author(s)
Bjoern Schwalb
See Also
Examples
x = c(rnorm(50),rnorm(100,2),rnorm(50,4))
y = (x + rnorm(200,0,0.8))*rep(c(1,4,1),c(50,100,50))
x = sign(x)*abs(x)^1.3
groups = list("Green" = 1:50,"Red" = 51:150,"Blue" = 151:200)
colors = c("darkgreen","darkred","darkblue")
ellipsescatter(x,y,groups,colors,location = "topleft")