Learn R Programming

ArchaeoPhases (version 1.1)

MultiSuccessionPlot: Successive Phases Density Plots (for groups in temporal order constraint)

Description

This functions draws a plot of the densities of several successive phases and adds several statistics (mean, CI, HPDR). The result is given in calendar year (in format BC/AD).

Usage

MultiSuccessionPlot(data, position_minimum, position_maximum = position_minimum+1,
 level = 0.95, title = "Characterisation of a succession of groups", 
 colors = NULL, exportFile = NULL, exportFormat = "PNG")

Arguments

data

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

position_minimum

numeric vector containing the column number corresponding to the minimum of the dates included in each group

position_maximum

numeric vector containing the column number corresponding to the maximum of the dates included in each group. By default, position_maximum = position_minimum + 1.

level

probability corresponding to the level of confidence

title

title of the graph

colors

numeric vector of colors for each group of dates

exportFile

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

exportFormat

the format of the export file : SVG or PNG.

Value

Returns a plot of all densities and adds several summary statistics. The result is given in calendar year (in format BC/AD).

Details

Curves represent the density of the minimum (oldest dates) and the maximum (youngest dates) of the dates included in each group. Curves of the same color refer to the same phase. When there is only one curve of one color, it means that there is only one event in the corresponding group and then the minimum equals the maximum. Time range intervals are symbolised by segments above the curves drawn using the same color as the one of the curves of the associated group. Transition and gap range intervals are represented by two-coloured segments using the colors of successive phases. If the gap between the successive groups does not exist, a cross is drawn instead of a segment.

Examples

Run this code
  # Data extracted from ChronoModel software
  data(Phases)
  
  # List of the name of the groups 
  names(Phases)
  
  # Stipulating position_end
  MultiSuccessionPlot(Phases, c(4,2), c(5,3), title = "Succession of phase 1 and phase 2")
  
  # In this case, equivalent to 
  MultiSuccessionPlot(Phases, c(4,2), title = "Succession of phase 1 and phase 2", colors = c(3,4))
  
  # export
  MultiSuccessionPlot(Phases, c(4,2), exportFile = "MultiSuccessionPlot", exportFormat = "SVG")

Run the code above in your browser using DataLab