Description Usage Arguments See Also Examples
Make a ggplot with 'geom_histogram' that contains outlier bins. Bins can be created for both floor and ceiling outliers. Code is experimental so expect some deviations from normal plotting, like messed-up grid lines.
1 2 3 | gg_outlier_bin(x, var_name, cut_off_floor, cut_off_ceiling, col = "black",
fill = "cornflowerblue", fill_outlier_bins = "forestgreen",
binwidth = NULL)
|
x |
a dataframe. |
var_name |
the name of the variable to visualize. |
cut_off_floor |
the floor of the histogram, all values below it will be put in the same bin. If 'NA“ no floor bin is created. |
cut_off_ceiling |
the ceiling of the histogram, all values above it will be put in the same bin. If 'NA“ no ceiling bin is created. |
col |
the color of the histogram. |
fill |
the fill of the regular histogram bins. |
fill_outlier_bins |
the fill of the outlier bins, make them a separate color to stress there different nature. |
binwidth |
the binwidth of the histogram. |
https://edwinth.github.io/blog/outlier-bins/
1 2 3 | library(tidyverse)
data_frame(x = c(runif(100, 0, 1000), rnorm(1000, 500, 3))) %>%
gg_outlier_bin("x", 520, 480)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.