knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.align = "center",
  fig.path = "man/figures/README-",
  fig.width = 7,
  out.width = NULL
)
Sys.setenv(LANGUAGE = "en") # Force locale

ArchaeoPhases

R-CMD-check codecov Dependencies

r-universe{.pkgdown-devel} CRAN Version{.pkgdown-release} CRAN checks{.pkgdown-release} CRAN Downloads{.pkgdown-release}

Project Status: Active – The project has reached a stable, usable state and is being actively developed.

DOI DOI JSS

Overview

Statistical analysis of archaeological dates and groups of dates. ArchaeoPhases allows to post-process Markov Chain Monte Carlo (MCMC) simulations from ChronoModel [@lanos2020], Oxcal [@bronkramsey2009] or BCal [@buck1999]. This package provides functions for the study of rhythms of the long term from the posterior distribution of a series of dates (tempo and activity plot). It also allows the estimation and visualization of time ranges from the posterior distribution of groups of dates (e.g. duration, transition and hiatus between successive phases).

ArchaeoPhases v2.0 brings a comprehensive package rewrite, resulting in the renaming of nearly all functions. For more information, please refer to news(Version >= "2.0", package = "ArchaeoPhases").

cite <- utils::citation("ArchaeoPhases")
print(cite, bibtex = FALSE)

Installation

You can install the released version of ArchaeoPhases from CRAN with:

install.packages("ArchaeoPhases")

And the development version from GitHub with:

# install.packages("remotes")
remotes::install_github("ArchaeoStat/ArchaeoPhases")

You can install the 1.x releases from the CRAN archives:

# install.packages("remotes")
remotes::install_version("ArchaeoPhases", version = "1.8")

Usage

ArchaeoPhases v2.0 uses aion for internal date representation. Look at vignette("aion", package = "aion") before you start.

These examples use data available through the ArchaeoData package which is available in a separate repository. ArchaeoData provides MCMC outputs from ChronoModel, OxCal and BCal.

## Install data package
install.packages("ArchaeoData", repos = "https://archaeostat.r-universe.dev")
## Load package
library(ArchaeoPhases)

Import a CSV file containing a sample from the posterior distribution:

## Construct the paths to the data
path <- file.path("chronomodel", "ksarakil")
path_event <- system.file(path, "Chain_all_Events.csv", package = "ArchaeoData")
path_phase <- system.file(path, "Chain_all_Phases.csv", package = "ArchaeoData")

## Read events from ChronoModel
(chrono_events <- read_chronomodel_events(path_event))

## Read phases from ChronoModel
(chrono_phases <- read_chronomodel_phases(path_phase))

Analysis of a series of dates

## Plot the first event
plot(chrono_events[, 1], interval = "hdr")

## Plot all events
plot(chrono_events)
## Tempo plot
tp <- tempo(chrono_events, level = 0.95)
plot(tp)

## Activity plot
ac <- activity(chrono_events)
plot(ac)

Analysis of a group of dates (phase)

bound <- boundaries(chrono_phases, level = 0.95)
as.data.frame(bound)
## Plot all phases
plot(chrono_phases)
plot(chrono_phases[, c("UP", "EPI"), ], succession = "hiatus")
plot(chrono_phases[, c("UP", "EPI"), ], succession = "transition")

Translation

This package provides translations of user-facing communications, like messages, warnings and errors, and graphical elements (axis labels). The preferred language is by default taken from the locale. This can be overridden by setting of the environment variable LANGUAGE (you only need to do this once per session):

Sys.setenv(LANGUAGE = "<language code>")

Languages currently available are English (en) and French (fr).

References



ArchaeoStat/ArchaeoPhases documentation built on Jan. 19, 2025, 2:33 p.m.