plotjit | R Documentation |
Plot comparing classes, with jittered points (random noise is added over the x-acis) for avoiding overplotting.
plotjit(x, y, group = NULL,
jit = 1, col = NULL, alpha.f = .8,
legend = TRUE, legend.title = NULL, ncol = 2, med = TRUE,
...)
x |
A vector of length |
y |
A vector of length |
group |
A vector of length |
jit |
Scalar defining the jittering magnitude. Default to 1. |
alpha.f |
Scalar modifying the opacity of the points in the graphics; typically in [0,1]. See |
col |
A color, or a vector of colors (of length equal to the number of classes or groups), defining the color(s) of the points. |
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. |
med |
Logical. If |
... |
Other arguments to pass in |
A plot.
n <- 500
x <- c(rep("A", n), rep("B", n))
y <- c(rnorm(n), rnorm(n, mean = 5, sd = 3))
group <- sample(1:2, size = 2 * n, replace = TRUE)
plotjit(x, y, pch = 16, jit = .5, alpha.f = .5)
plotjit(x, y, pch = 16, jit = .5, alpha.f = .5,
group = group)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.