plot.fitdistr.grouped {sn} | R Documentation |
Plot an object generated by fitdistr.grouped
Description
The object produced by fitdistr.grouped
is plotted in the form
of an histogram of the input original observed frequencies with superimposed
the fitted parametric density function.
Usage
## S3 method for class 'fitdistr.grouped'
plot(x, freq = FALSE, col = "grey90",
border = "grey80", pdfcol = "blue", main, sub = NULL, xlab, ylab, xlim, ylim,
axes = TRUE, labels = FALSE, ...)
Arguments
x |
a |
freq |
logical; if |
col |
a colour to be used to fill the bars. |
border |
the colour of the border around the bars. |
pdfcol |
the colour of the fitted parametric distribution. |
main , sub , xlab , ylab |
these arguments to |
xlim , ylim |
the range of |
axes |
logical, indicating if axes should be drawn. |
labels |
logical or character. Additionally draw labels on top of bars, if not FALSE; if TRUE, draw the counts or rounded densities; if labels is a character, draw itself. |
... |
further graphical parameters to title and axis. |
Details
The function builds on plot.histogram
,
but some lesser features have been dropped.
Value
A list with the following components
hist |
an object of class |
x , y |
the values used for plotting the fitted parametric distribution. |
Author(s)
Adelchi Azzalini
See Also
fitdistr.grouped
for generating a suitable object,
plot.histogram
for the related more general function.
Examples
data(barolo)
attach(barolo)
A75 <- (reseller=="A" & volume==75)
logPrice <- log(price[A75],10) # as used in selm documentation; see its fitting
detach(barolo)
breaks<- seq(1, 3, by=0.25)
f <- cut(logPrice, breaks = breaks)
freq <- tabulate(f, length(levels(f)))
logPrice.grouped <- fitdistr.grouped(breaks, freq, family='ST')
plot(logPrice.grouped)