Add data points
Usageadd_data_points(
plot,
data = all_rows(),
shape = 19,
size = 1,
white_border = FALSE,
dodge_width = NULL,
preserve = "total",
rasterize = FALSE,
rasterize_dpi = 300,
...
)
add_data_points_jitter(
plot,
data = all_rows(),
shape = 19,
size = 1,
white_border = FALSE,
dodge_width = NULL,
jitter_width = 0.2,
jitter_height = 0,
preserve = "total",
rasterize = FALSE,
rasterize_dpi = 300,
...
)
add_data_points_beeswarm(
plot,
data = all_rows(),
shape = 19,
size = 1,
white_border = FALSE,
cex = 3,
corral = "wrap",
corral.width = 0.5,
dodge_width = NULL,
preserve = "total",
rasterize = FALSE,
rasterize_dpi = 300,
...
)
Arguments
A tidyplot
generated with the function tidyplot()
.
The data to be displayed in this layer. There are three options:
If all_rows()
(the default) the complete dataset is displayed.
A function
to subset the plot data. See filter_rows()
and friends.
A data.frame
to override the plot data.
An integer
between 0
and 24
, representing the shape of the plot symbol.
A number
representing the size of the plot symbol. Typical values range between 1
and 3
.
Whether to include a white border around data points. Defaults to FALSE
.
For adjusting the distance between grouped objects. Defaults to 0.8
for plots with at least one discrete axis and 0
for plots with two continuous axes.
Should dodging preserve the "total"
width of all elements at a position, or the width of a "single"
element?
If FALSE
(the default) the layer will be constructed of vector shapes. If TRUE
the layer will be rasterized to a pixel image. This can be useful when plotting many individual objects (1,000 or more) compromises the performance of the generated PDF file.
The resolution in dots per inch (dpi) used for rastering the layer if rasterize
is TRUE
. The default is 300
dpi.
Arguments passed on to the geom
function.
Amount of random noise to be added to the horizontal position of the of the data points. This can be useful to deal with overplotting. Typical values range between 0
and 1
.
Amount of random noise to be added to the vertical position of the of the data points. This can be useful to deal with overplotting. Typical values range between 0
and 1
.
Scaling for adjusting point spacing (see beeswarm::swarmx()
). Values between 1 (default) and 3 tend to work best.
string
. Method used to adjust points that would be placed to wide horizontally, default is "none"
. See details below.
numeric
. Width of the corral, default is 0.9
.
study |>
tidyplot(x = treatment, y = score, color = treatment) |>
add_data_points()
study |>
tidyplot(x = treatment, y = score, color = treatment) |>
add_data_points_jitter()
study |>
tidyplot(x = treatment, y = score, color = treatment) |>
add_data_points_beeswarm()
# Changing arguments
study |>
tidyplot(x = treatment, y = score, color = treatment) |>
add_data_points_jitter(jitter_width = 1)
animals |>
tidyplot(x = weight, y = size) |>
add_data_points(white_border = TRUE)
animals |>
tidyplot(x = weight, y = size) |>
add_data_points(alpha = 0.4)
# Rasterization
animals |>
tidyplot(x = weight, y = size) |>
add_data_points(rasterize = TRUE, rasterize_dpi = 50)
# Data subsetting
animals |>
tidyplot(x = weight, y = size) |>
add_data_points() |>
add_data_points(data = filter_rows(size > 300), color = "red")
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4