Plot or add probability distributions from a paleo or chron model to a plot.

plotModelDistributions(
  L,
  dist.var = "age",
  y.var = "depth",
  mode = "chron",
  paleo.or.chron.num = 1,
  model.num = 1,
  add.to.plot = ggplot(),
  alp = 0.5,
  color = "purple",
  scale.frac = 0.02,
  dist.plot = NA,
  dist.type = "violin",
  thick = 0.1,
  truncate.dist = NA
)

Arguments

L

A LiPD object - an R serialization of a single LiPD file. It's a list, and is typically created by `readLipd()`

dist.var

Name of the distribution variable, will be plotted along the x-axis. Use coord_flip() after running the function if you want vertical distributions. "age" by default.

y.var

Name of the y-axis variable. "depth" by default.

mode

chron or paleo

paleo.or.chron.num

number of the chron or paleo Data object

model.num

number of the model object

add.to.plot

A ggplot object to add this plot to. Default is ggplot()

alp

transparency, from 0 to 1

color

distribution color (following ggplot rules)

scale.frac

controls the vertical span of the probability distribution. Approximately the vertical fraction of the plot that the distribution will cover.

dist.plot

vector of distribution tables to plot

dist.type

"violin" (default), "high" for one-sided distributions towards higher depths, "low" for one-sided distributions towards lower depths

thick

thickness of the line around the distribution

truncate.dist

truncate probability density values below this number. NA (default) means no truncation

Value

A ggplot object

Author

Nick McKay