Learn R Programming

ArchaeoPhases (version 1.4)

MultiDatesPlot: Plot of the endpoints of credible intervals or HPD intervals of a series of dates

Description

Draws a plot of segments corresponding to the endpoints of the intervals (CI or HPD) of each selected date. The result is given in calendar year (in format BC/AD).

Usage

MultiDatesPlot(data, position, level = 0.95, intervals = "CI", order ="default", 
                            title = "Plot of intervals",
                            subtitle = NULL,
                            caption = "ArchaeoPhases",
                            labelXaxis = "Calendar Year",
                            labelYaxis = NULL,
                            height = 7, width = 7, units = "in",
                            x.min = NULL, x.max = NULL,
                            x.scale = "calendar",
                            elapsed.origin.position = NULL,
                            dumbbell.size = 3, dot.guide = FALSE,
                            dot.guide.size = 0.25, y.grid = FALSE,
                            file = NULL, newWindow=TRUE, print.data.result = FALSE)

Arguments

data

dataframe containing the output of the MCMC algorithm. The MCMC samples should be in calendar year (BC/AD).

position

numeric vector containing the position of the column corresponding to the MCMC chains of interest

level

probability corresponding to the level of confidence used to estimate the credible interval

intervals

"CI" corresponds to the credible intervals, "HPD" to the highest density regions

order

"default" the y axis follows the order of the csv file. "increasing" the y axis is ordered according to the values of the interval (CI or the first HPD interval)

title

title of the graph

subtitle

subtitle of the graph

caption

caption of the graph

labelXaxis

x axis label of the graph

labelYaxis

y axis label of the graph

height

height of the graph in units

width

width of the graph in units

units

recognized by ggsave function, one of "in", "cm", "mm"

x.min

minimum x axis value

x.max

maximum x axis value

x.scale

one of "calendar" for calendar years, "BP" for years before present, or "elapsed" for years after a specified origin

elapsed.origin.position

the position of the column corresponding to the origin for elapsed time calculations

dumbbell.size

size of the symbols used to plot dates

dot.guide

switch for guides from y-axis to plot symbols

dot.guide.size

size of the dot guides

y.grid

switch for horizontal grids

file

the name of the file to be saved. If NULL then no graph is saved.

newWindow

whether the plot is drawn within a new window or not

print.data.result

If TRUE, the list containing the data to plot will be given

Examples

Run this code
# NOT RUN {
  data(Events)
  MultiDatesPlot(Events, c(2,4,3), level = 0.95, intervals ="CI", title = "Plot of CI intervals")
  MultiDatesPlot(Events, c(2,4,3), level = 0.95, intervals ="HPD", title = "Plot of HPD intervals")
  MultiDatesPlot(Events, c(2,4,3), level = 0.95, intervals ="HPD", , order="increasing")
# }

Run the code above in your browser using DataLab