ppdPlot: R function for plotting Posterior Probability Densities for...

Description Usage Arguments Examples

View source: R/ppd_plot.r

Description

The function allows plot Posterior Probability Densities with a nice outlook thanks to 'ggplot2'.
It takes as input a dataframe that must be organized as follows (it is rather easy to do that once the data have been exported from OxCal):
-calendar dates (first column to the left);
-posterior probabilities (second column);
-grouping variables (third column), which could contain the names of the events of interest (e.g., phase 1 start, phase 1 end, phase 2 start, phase 2 end, etc).

Usage

1
ppdPlot(data, lower = min(data[, 1]), upper = max(data[, 1]), type)

Arguments

data:

dataframe containing the data as returned by the OxCal program.

lower:

lower limit of the calendar date axis.

upper:

upper limit of the calendar date axis; if the lower and upper parameters are not provided, the default values will be the earliest and latest calendar dates.

type:

type of plot the user wishes to plot (a: curves outlined by a line; b: curves plotted as solid areas; c: combination of a and b).

Examples

1
2
3
data(radioc_data) #load a toy dataset
ppdPlot(radioc_data, type="a") #plot the Posterior Probability Densities for the phases' parameters
ppdPlot(radioc_data, -1000, 100, type="b") #plot the Posterior Probability Densities for the phases' parameters, setting different boundaries for the x-axis and using filled curves instead of simple outlines

gianmarcoalberti/GmAMisc documentation built on May 3, 2019, 6:44 p.m.