
Last chance! 50% off unlimited learning
Sale ends in
a smooth histogram with unit indicator
(we're simply scaling the kernel density estimate). The advantage of this plot
is its interpretability since the height of the curve represents the
frequency of a interval of size unit
around the point in question.
Another advantage is that if z
is a matrix, curves are plotted
together.
shist(z, unit, bw = "nrd0", n, from, to, plotHist = FALSE, add = FALSE,
xlab, ylab = "Frequency", xlim, ylim, main, ...)
the data
the unit which determines the y axis scaling and is drawn
arguments to density
arguments to density
arguments to density
arguments to density
a logical: should an actual histogram be drawn under curve?
a logical: add should the curve be added to existing plot?
x-axis title, defaults to no title
y-axis title, defaults to no title
range of the x-axis
range of the y-axis
an overall title for the plot: see title
.
arguments to lines
set.seed(1)
x = rnorm(50)
par(mfrow=c(2,1))
hist(x, breaks=-5:5)
shist(x, unit=1, xlim=c(-5,5))
Run the code above in your browser using DataLab