position_jitter
to see how to adjust amount
of jittering.geom_jitter(mapping = NULL, data = NULL,
stat = "identity", position = "jitter", na.rm = FALSE,
...)
aes
or aes_string
. Only
needs to be set at the layer level if you are overriding
the plot defaults.FALSE
(the default), removes
missing values with a warning. If TRUE
silently
removes missing values.# Add aesthetic mappings p + geom_jitter(aes(colour = cyl))
# Vary parameters p + geom_jitter(position = position_jitter(width = .5)) p + geom_jitter(position = position_jitter(height = .5))
# Use qplot instead qplot(displ, hwy, data = mpg, geom = "jitter") qplot(class, hwy, data = mpg, geom = "jitter") qplot(class, hwy, data = mpg, geom = c("boxplot", "jitter")) qplot(class, hwy, data = mpg, geom = c("jitter", "boxplot"))
geom_point
for regular, unjittered points,
geom_boxplot
for another way of looking at
the conditional distribution of a variable,
position_jitter
for examples of using
jittering with other geoms