Create a new tidyplot
Arguments
- data
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. Seefilter_rows()
and friends.A
data.frame
to override the plot data.
- ...
Mappings for the
x
axis,y
axis andcolor
, see examples. Additional argument are passed toggplot2::aes()
.- width
Width of the plot area. Defaults to
50
.- height
Height of the plot area. Defaults to
50
.- dodge_width
For adjusting the distance between grouped objects. Defaults to
0.8
.
Examples
study %>%
tidyplot(x = treatment, y = score, color = treatment) %>%
add_data_points_beeswarm()
study %>%
tidyplot(x = group, y = score, color = dose) %>%
add_mean_bar()
# Change plot area size
study %>%
tidyplot(x = treatment, y = score, color = treatment,
width = 35, height = 35) %>%
add_data_points_beeswarm()
# Change dodge_width
study %>%
tidyplot(x = group, y = score, color = dose, dodge_width = 0.3) %>%
add_mean_bar()