hist_group: Make a histogram categorized by grouping variable

Description Usage Arguments Value Examples

View source: R/hist_group.R

Description

This function make a histogram categorized by grouping variable

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
hist_group(
  data,
  var,
  group,
  show.hist = T,
  show.density = T,
  show.mean = T,
  bins = 50,
  alpha = 0.5
)

Arguments

data

a dataframe to be used

var

a numeric variable

group

a grouping variable (factor)

show.hist

a logical indicating whether to show histogram

show.density

a logical indicating whether to show density plot

bins

number of bins

alpha

transparency of density plot

Value

ggplot2 histogram

Examples

1
hist_group(mtcars, "mpg", "am")

nephroj/medicj documentation built on Dec. 22, 2021, 12:10 a.m.