Learn R Programming

ArchaeoPhases (version 1.4)

OccurrencePlot: Plot of the occurence of events

Description

A statistical graphic designed for the archaeological study of the timing of the occurrence of events.

Usage

OccurrencePlot(data, position, plot.result = NULL, level = 0.95, 
                           intervals = "CI",
                           title = "Occurrence plot",
                           subtitle = NULL,
                           caption = "ArchaeoPhases",
                           labelXaxis = "Calendar year",
                           labelYaxis = NULL,
                           language = "English", occurrence = "occurrence",
                           height = 7, width = 7, units = "in",
                           x.min = NULL, x.max = NULL, x.scale = "calendar",
                           elapsed.origin.position = NULL,
                           dumbbell.size = 1, 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

plot.result

a list containing the data to plot, typically the result of a previous run of OccurrencePlot()

level

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

intervals

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

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

language

English by default

occurrence

Text for the y-values

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

Value

It calculates the calendar date t corresponding to the smallest date such that the number of events observed before t is equal to k. The result is given in calendar year (in format BC/AD). It may also return a list containing the data to plot (if print.data.result = TRUE).

Details

If we have k events. We can estimate the calendar date t corresponding to the smallest date such that the number of events observed before t is equal to k. The OccurrencePlot estimates theses dates and give the credible interval or the highest posterior density (HPD) region of theses dates associated to a desired level of confidence.

Examples

Run this code
# NOT RUN {
  data(Events); 
  OccurrencePlot(Events[1:1000,], c(2:5),  print.data.result = FALSE)
# }

Run the code above in your browser using DataLab