View source: R/smooth_histogram.R
smooth_histogram | R Documentation |
This is an internal function that applies a moving average filter to smooth a histogram. It is not intended for direct use by package users.
smooth_histogram(hist_counts, window_size = 5)
hist_counts |
A numeric vector of histogram bin counts. |
window_size |
An integer specifying the smoothing window size (default is 5). |
A numeric vector of smoothed histogram counts.
raw_counts <- hist(rnorm(1000), plot = FALSE)$counts
smoothed <- smooth_histogram(raw_counts)
plot(smoothed, type = "l", col = "blue")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.