hist_group: Make a histogram categorized by grouping variable

View source: R/hist_group.R

hist_groupR Documentation

Make a histogram categorized by grouping variable

Description

This function make a histogram categorized by grouping variable

Usage

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

show.mean

a logical indicating whether to show mean values

bins

number of bins

alpha

transparency of density plot

Value

ggplot2 histogram

Examples

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


nephroj/medutils documentation built on Feb. 3, 2024, 8:33 a.m.