density_plot | R Documentation |
Like dnplot()
, but using ggplot2.
density_plot(M, labs)
M |
A vector or matrix of values upon which the density plot is based; if a matrix, separate densities will be estimated and plotted for each column |
labs |
If supplied, a legend is printed; order of |
M <- cbind(rgamma(1000, 2, 2), rnorm(1000))
colnames(M) <- c('Gamma', 'Normal')
density_plot(M[,1])
density_plot(M)
density_plot(rexp(100, 2), labs='Exponential')
density_plot(data.frame(Gamma=rgamma(1000, 2, 2), Normal=rnorm(1000)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.