Skip to contents
  • add_error() adds the standard error of mean.

  • add_range() adds the range from smallest to largest value.

  • add_sd() adds the standard deviation.

  • add_ci95() adds the 95% confidence interval.

Usage

add_error(
  plot,
  dodge_width = NULL,
  width = 0.4,
  linewidth = 0.25,
  preserve = "total",
  ...
)

add_range(
  plot,
  dodge_width = NULL,
  width = 0.4,
  linewidth = 0.25,
  preserve = "total",
  ...
)

add_sd(
  plot,
  dodge_width = NULL,
  width = 0.4,
  linewidth = 0.25,
  preserve = "total",
  ...
)

add_ci95(
  plot,
  dodge_width = NULL,
  width = 0.4,
  linewidth = 0.25,
  preserve = "total",
  ...
)

Arguments

plot

A tidyplot generated with the function tidyplot().

dodge_width

For adjusting the distance between grouped objects.

width

Horizontal width of the plotted object (bar, error bar, boxplot, violin plot, etc). Typical values range between 0 and 1.

linewidth

Thickness of the line in points (pt). Typical values range between 0.25 and 1.

preserve

Should dodging preserve the "total" width of all elements at a position, or the width of a "single" element?

...

Arguments passed on to the geom function.

Value

A tidyplot object

Examples

study %>%
  tidyplot(x = treatment, y = score, color = treatment) %>%
  add_data_points() %>%
  add_error()
#>  adjust_x_axis: discrete
#>  adjust_y_axis: continuous
#>  adjust_colors: Too many colors. 5 colors provided, but only 4 needed.
#>  adjust_colors: applied discrete color values
#>  adjust_plot_size: width = 50 mm, height = 50 mm

study %>%
  tidyplot(x = treatment, y = score, color = treatment) %>%
  add_data_points() %>%
  add_range()
#>  adjust_x_axis: discrete
#>  adjust_y_axis: continuous
#>  adjust_colors: Too many colors. 5 colors provided, but only 4 needed.
#>  adjust_colors: applied discrete color values
#>  adjust_plot_size: width = 50 mm, height = 50 mm

study %>%
  tidyplot(x = treatment, y = score, color = treatment) %>%
  add_data_points() %>%
  add_sd()
#>  adjust_x_axis: discrete
#>  adjust_y_axis: continuous
#>  adjust_colors: Too many colors. 5 colors provided, but only 4 needed.
#>  adjust_colors: applied discrete color values
#>  adjust_plot_size: width = 50 mm, height = 50 mm

study %>%
  tidyplot(x = treatment, y = score, color = treatment) %>%
  add_data_points() %>%
  add_ci95()
#>  adjust_x_axis: discrete
#>  adjust_y_axis: continuous
#>  adjust_colors: Too many colors. 5 colors provided, but only 4 needed.
#>  adjust_colors: applied discrete color values
#>  adjust_plot_size: width = 50 mm, height = 50 mm