Description Usage Arguments Examples
View source: R/plotMultipleHistograms.R
This function uses the hist function to plot multiple distributions in the same plot
1 | plotMultipleHistograms(distributions, nBins = 10, colours, ...)
|
distributions |
A list containing multiple distributions - each represented as a numeric vector |
nBins |
The number of bins to be used in the plot. Defaults to 10 |
colours |
A vector of length |
... |
Arguments to be passed to |
1 2 3 4 5 6 7 | # Create two random samples from a normal distribution
distributions <- list(rnorm(500, mean=5, sd=0.5),
rnorm(500, mean=8, sd=5),
rnorm(500, mean=20, sd=2))
# Plot overlapping histograms
plotMultipleHistograms(distributions, nBins=20, colours=c(rgb(1,0,0, 0.5), rgb(0,0,1, 0.5), rgb(0,1,0, 0.5)), las=1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.