PlotDistDensityNormal: Plot an empirical density with the matching normal...

Description Usage Arguments Details See Also Examples

View source: R/DistributionPlot.R

Description

Compares empirical data to a normal distribution with the same mean and standard deviation.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
PlotDistDensityNormal(
  frm,
  xvar,
  title,
  ...,
  adjust = 0.5,
  curve_color = "lightgray",
  normal_color = "blue",
  mean_color = "blue",
  sd_color = "darkgray"
)

Arguments

frm

data frame to get values from

xvar

name of the independent (input or model) column in frame

title

title to place on plot

...

no unnamed argument, added to force named binding of later arguments.

adjust

passed to geom_density; controls smoothness of density plot

curve_color

color for empirical density curve

normal_color

color for theoretical matching normal

mean_color

color of mean line

sd_color

color for 1-standard deviation lines (can be NULL)

Details

Plots the empirical density, the theoretical matching normal, the mean value, and plus/minus one standard deviation from the mean.

See Also

geom_density

Examples

1
2
3
4
5
6
set.seed(52523)
d <- data.frame(wt=100*rnorm(100))
PlotDistDensityNormal(d,'wt','example')

# no sd lines
PlotDistDensityNormal(d, 'wt', 'example', sd_color=NULL)

WinVector/WVPlots documentation built on Jan. 12, 2021, 2:38 a.m.