histr | R Documentation |
A histogram with density curve and rug.
histr(x, ..., lines.pars, rug.pars, poly.pars, reset_par = TRUE)
x |
a vector of values for which the histogram is desired |
... |
additional parameters passed to |
lines.pars |
optional list of additional parameters passed to
|
rug.pars |
optional list of additional parameters passed to
|
poly.pars |
optional list of additional parameters passed to
|
reset_par |
logical; if |
A list of length two containing the return value of hist
and density
for x
.
set.seed(1)
histr(x <- rnorm(100), xlim = c(-3, 3), las = 1)
plot(density(x), xlim = c(-3, 3))
histr(
x + 50, main = 'Age at diagnosis', xlab = 'Age',
poly.pars = list(col = 'dodgerblue2', density = 30),
lines.pars = list(lty = 'dashed', lwd = 3),
rug.pars = list(side = 3, col = 'red')
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.