Description Usage Arguments Value Examples
Construct a density histogram (i.e. probability = TRUE
) as an xy-list
in a form suitable for superimposing on other graphics, e.g. density plots.
NOTE: this is NOT a plotting function. Use hist(x, probability = TRUE)
for direct plots.
1 2 3 4 5 6 7 8 9 10 11 |
x, ... |
As for |
polygon |
logical: suitable for use with |
plot |
Ignored. Plotting is always suppressed |
A list with components including x
and y
suitable for superimposing on other graphics with lines()
1 2 3 4 5 6 7 | d <- density(~log(crim), MASS::Boston)
h <- density_histogram(~log(crim), MASS::Boston, binWidth(1/3))
plot(d, xlim = xrange(d, h), ylim = yrange(d, h),
main = "", xlab = "log(crim)", col = "blue")
lines(update(h, polygon = FALSE), col = alpha("red", 0.5))
polygon(h, fill = alpha("red", 0.5),
colour = "transparent")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.