densityPlot | R Documentation |
returns a histogram+density ggplot (or a list thereof if several columns in sim)
densityPlot(sim, xlab = "values", col = "black")
sim |
vector or matrix or data frame, MCMC simulations |
xlab |
Character, label of x-axis to be used if sim has no names |
col |
Color |
A ggplot (or a list thereof if several columns in sim)
# Create Monte Carlo samples
n=1000
sim=data.frame(p1=rnorm(n),p2=rlnorm(n),p3=runif(n))
# create density plot for each component
figures=densityPlot(sim)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.