Skip to contents

Create a new tidyplot

Usage

tidyplot(data, ..., width = 50, height = 50, dodge_width = 0.8)

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. See filter_rows() and friends.

  • A data.frame to override the plot data.

...

Mappings for the x axis, y axis and color, see examples. Additional argument are passed to ggplot2::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.

Value

A tidyplot object

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()