hist_cut_color: Histogram color partitioner

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/hist_cut_color.R

Description

Histogram with cut colors

Usage

1
2
3
4
5
6
7
8
9
hist_cut_color(
  vec = rnorm(2000, mean = 0, sd = 10),
  cutoff = c(-10, -3, 3, 10),
  cols = c("red", "green", "orange", "yellow", "purple"),
  legend_title = "QC",
  legend_labels = c("Filtered", "Passed", "orange", "yellow", "purple"),
  n_bins = 200,
  ...
)

Arguments

vec

a numeric vector

cutoff

numeric valu(s) of cut points (atomic or vector)

cols

vector of colors to use, if NULL, gg_color_hue(length(cutoff)+1) will be used

legend_title

title of the legend

legend_labels

character vector of label of the legends

n_bins

number of bins

...

other parameters passed to ggplot

Details

Partition histogram by color - output is a ggplot2 object which can be extended using labs etc

Value

a histogram with different colors b/w cutoff points

Author(s)

Al J Abadi, aljalabadi@gmail.com

See Also

Other plot: gg_color_hue()

Examples

1
hist_cut_color() + labs(x='X label here', title='Main title here')

aljabadi/Altools documentation built on Jan. 17, 2022, 8:55 a.m.