Description Usage Arguments Examples
This is a wrapper function for the stat_ecdf function and helps make it easy to directly compare distributions at specific locations along the scale.
| 1 2 3 4 5 6 7 8 9 10 11 12 | 
| data | A tidy data frame containing the data to be plotted. | 
| formula | A formula of the type  | 
| cuts | Optional numeric vector stating the location of reference line(s) and/or rectangle(s). | 
| linewidth | Width of ECDF lines. Note that the color of the lines can 
be controlled through additional functions (e.g.,  | 
| ref_line_cols | Optional vector (or single value) of colors for 
 | 
| ref_linetype | Optional vector (or single value) of line types for 
 | 
| center | Logical. Should the functions be centered prior to plotting? 
Defaults to  | 
| ref_rect | Logical, defaults to  | 
| ref_rect_col | Color of the fill for the reference rectangles. Defaults to a dark gray. | 
| ref_rect_alpha | Transparency of the fill for the reference rectangles. Defaults to 0.7. | 
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ecdf_plot(benchmarks, math ~ ell, 
          cuts = c(190, 205, 210), 
          ref_line_cols = c("#D68EE3", "#9BE38E", "#144ECA"))
# Customize the plot with ggplot2 functions
library(ggplot2)
ecdf_plot(benchmarks, math ~ ell, 
          cuts = c(190, 205, 210), 
          ref_line_cols = c("#D68EE3", "#9BE38E", "#144ECA")) +
  theme_minimal() +
  theme(legend.position = "bottom")
ecdf_plot(seda, mean ~ grade) +
  scale_fill_brewer(palette = "Set2") +
  theme_minimal()
  
# Use within the dplyr pipeline
library(dplyr)
benchmarks %>% 
  mutate(season = factor(season, 
                         levels = c("Fall", "Winter", "Spring"))) %>% 
  ecdf_plot(math ~ ell + season + frl)
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.