Generates Histograms
plotHistogram.RdProduces histograms with optional distribution fit.
For more details and examples see the vignettes:
vignette("Histogram Plots", package = "ospsuite.plots")vignette("ospsuite.plots", package = "ospsuite.plots")vignette("Goodness of fit", package = "ospsuite.plots")
Usage
plotHistogram(
data,
mapping,
metaData = NULL,
asBarPlot = NULL,
geomHistAttributes = getDefaultGeomAttributes("Hist"),
plotAsFrequency = FALSE,
xscale = AxisScales$linear,
xscale.args = list(),
yscale = AxisScales$linear,
yscale.args = list(),
distribution = "none",
meanFunction = "auto",
residualScale = ResidualScales$log
)Arguments
- data
data.frame with simulated data will be displayed as lines with ribbons
- mapping
a list of aesthetic mappings to use for plot, additional to
{ggplot2}aesthetics, the aestheticsgroupby,error,error_relative,lloq,mdv,y2axisare available, see vignettes for more details and examples- metaData
A named list of information about
datasuch as thedimensionandunitof its variables.- asBarPlot
A
logicalindicating ifgeom_histogramshould be used (for continuous data) orgeom_bar(for categorical data). If TRUE, the variablesdistribution,meanFunction,xscale, andxscale.argsare ignored.- geomHistAttributes
A
listof arguments passed toggplot2::geom_histogram(orgeom_barifasBarPlot= TRUE).- plotAsFrequency
A
logicalindicating if the histogram displays frequency on the y-axis.- xscale
either 'linear' then
ggplot2::scale_x_continuous()or 'log' thenggplot2::scale_x_log10()is used- xscale.args
list of arguments passed to
ggplot2::scale_x_continuous()orggplot2::scale_x_log10()- yscale
either 'linear' then
ggplot2::scale_y_continuous()or 'log' thenggplot2::scale_y_log10()is used- yscale.args
list of arguments passed to
ggplot2::scale_y_continuous()orggplot2::scale_y_log10()- distribution
Name of the distribution to fit. Available distributions are those in the
statspackage (see ?stats::distributions):norm,lnorm,weibull,gamma, etc. Use"none"for no fit (default). Shortcuts:"normal"(same as"norm"),"lognormal"(same as"lnorm").- meanFunction
Function selection for the display of a vertical line. Options:
'none','mean','geomean','median','auto'(default).'auto'selects'mean'for normal distribution,'geomean'for lognormal,'median'for other distributions, and'none'when no distribution fit.- residualScale
Either "linear", "log", or "ratio" scale for residuals.
See also
Other plot functions:
plotBoxWhisker(),
plotForest(),
plotPredVsObs(),
plotQQ(),
plotRangeDistribution(),
plotRatioVsCov(),
plotResVsCov(),
plotTimeProfile(),
plotYVsX()