add_norm | R Documentation |
This function will add a normal curve to a frequency or density histogram using the raw data and histogram object as arguments.
add_norm( h, data, freq = TRUE, na.rm = FALSE, lty = 1, lwd = 2, col = "purple", ... )
h |
Histogram object generated by |
data |
Vector of values used to generate the histogram. |
freq |
Logical value indicating whether y-axis of histogram is frequency. Defaults to TRUE. |
na.rm |
Logical value indicating whether NA values should be stripped before the computation proceeds. Defaults to TRUE. |
... |
Other |
x <- rnorm(30, 5, 2) hi <- hist(x) add_norm(h = hi, data = x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.