Description Usage Arguments Value Examples
View source: R/averaged_shifted_histograms.R
Create a smoothed histogram by averaging several histograms shifted by fractions of a bin-width
1 2 3 |
x |
a vector of values for which the histogram is desired |
n.breaks |
an integer giving the number of bins to be used |
n.shifts |
an integer giving the number of shifts to be performed |
type |
if |
freq |
should frequency counts be used, or density (default) |
plot |
logical; if |
add |
logical; if |
... |
further graphical parameters to |
an object of class "histogram"
1 2 3 4 5 6 7 8 9 10 11 12 13 | set.seed(1)
n <- 6
x <- sample(sample(0:20, 8), 6*n, replace=TRUE) + rnorm(6*n, -8, 0.5)
x <- c(x, rgamma(5*n, 3, 0.5), rnorm(4*n, 15, 2))
x <- round(x*5)/5
hist(x, freq=FALSE, breaks="FD", col="lightblue")
ahist(x, type="hist", border=2, col=7, freq=FALSE, lwd=2)
ahist(x, type="poly", border=2, col=7, freq=FALSE, lwd=2)
ahist(x, type="line", col=2, freq=FALSE, lwd=2)
ahist(x, type="table", col=2, freq=FALSE, lwd=2)
ahist(x, plot=FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.