eda_jitter | R Documentation |
eda_jitter
creates a jitter plot from a continuous
variable conditioned on a categorical variable.
eda_jitter(
dat,
x,
fac = NULL,
jitter = 0.05,
p = 1,
tukey = FALSE,
horiz = FALSE,
stat = mean,
show.stat = TRUE,
stat.type = "p",
stat.col = "firebrick",
stat.fill = "bisque",
stat.size = 2,
stat.pch = 21,
stat.pad = 1,
xlab = NULL,
ylab = NULL,
grey = 0.6,
pch = 21,
p.col = "grey50",
p.fill = "grey80",
size = 0.8,
alpha = 0.8,
reorder = TRUE,
show.par = TRUE,
ylim = NULL
)
dat |
Dataframe. |
x |
Continuous variable. |
fac |
Categorical variable. |
jitter |
Jittering parameter. A fraction of the group width
( |
p |
Power transformation to apply to variable |
tukey |
Boolean determining if a Tukey transformation should be adopted
( |
horiz |
Plot horizontally ( |
stat |
Choice of summary statistic to use when fitting a central value
to the data. |
show.stat |
Boolean determining if a summary statistic should be added to jitter plot. |
stat.type |
Symbol to use to display statistical summary. Can be either
a point, |
stat.col |
Symbol color to use to display statistical summary. If
|
stat.fill |
Fill color to use for the point statistical summary if the
point symbol type, |
stat.size |
Size of point statistical summary if |
stat.pch |
Point statistical summary type (1 through 25). Ignored if
|
stat.pad |
Fraction to add to the length of the line statistical
summary. Ignored if |
xlab |
X label for output plot |
ylab |
Y label for output plot |
grey |
Grey level to apply to plot elements (0 to 1 with 1 = black) |
pch |
Point symbol type |
p.col |
Color for point symbol |
p.fill |
Point fill color passed to |
size |
Point size (0-1). |
alpha |
Point transparency (0 = transparent, 1 = opaque). Only
applicable if |
reorder |
Boolean determining if factors have to be reordered based
on |
show.par |
Boolean determining if power transformation should be displayed in the plot. |
ylim |
Define custom y axis limits (or x limits if |
Function generates jitter plot from a univariate dataset. If no categorical
variable is passed to the function, a single jitter plot is created from the
data.
By default, the plots are ordered based on the statistic, stat
, used to generate
the central value.
No values are returned
# A basic jitter plot for a single variable where the mean is automatically
# fitted to the data
eda_jitter(iris, Sepal.Width)
# A basic jitter plot conditioned on a categorical variable
eda_jitter(iris, Sepal.Width, Species)
# Use line instead of point for summary statistic
eda_jitter(iris, Sepal.Width, Species, stat.type = "l")
# You can apply a transformation to the data. The summary statistic will be
# computed after the data are transformed.
eda_jitter(mtcars, hp, cyl, stat.type = "l", p = 0)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.