PlotHistAndNormal: Plots histogram and Normal distribution

Description Usage Arguments Value

Description

Plots a histogram of the data with an option to fit a Normal distribution.

Usage

1
2
PlotHistAndNormal(df, var, by, pars, xlim, bin_width, fit_normal,
  fit_color, x_lab, title, hold_axes, labels, lines)

Arguments

df

Dataframe of data

var

Column name of variable to fit Normal distribution

by

Column name used to subset data, optional. Default is NULL

pars

Parameters, optional. A set of parameters used in place of pars generated within the function. Default is NULL.

xlim

Numeric, x-value axis limits, if only one value is given, that is used as the max limit. Default is NULL.

bin_width

Numeric, bin size. Default is: x-value range/30

fit_normal

Logical, whether or not to fit and show Normal distribution. Default is TRUE.

fit_color

String, color used for Normal fit line, quantiles, and parameter value text. Default is "orangered".

x_lab

String, label for x-axis. Default is variable name.

title

String, main title name. Default is NULL.

hold_axes

Logical, hold axes even if parameter distribution goes off of the screen. Default is TRUE.

labels

Logical, show quantile labels. Default is TRUE.

lines

Logical, show quantile lines. Default is TRUE.

Value

Plots with a Normal distribution fitted for each 'by' factor


Blakemassey/baear documentation built on Dec. 25, 2021, 9:48 a.m.