Learn R Programming

RBaM (version 1.1.1)

densityPlot: densityPlot

Description

returns a histogram+density ggplot (or a list thereof if several columns in sim)

Usage

densityPlot(sim, xlab = "values", col = "black")

Value

A ggplot (or a list thereof if several columns in sim)

Arguments

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

Examples

Run this code
# 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)

Run the code above in your browser using DataLab