This vignette uses data available through the ArchaeoData package which is available in a separate repository. ArchaeoData provides OxCal (Bronk Ramsey 2009) input models.

## Install the latest version
install.packages("ArchaeoData", repos = "https://archaeostat.r-universe.dev")
## Load package
library(ArchaeoCal)

## Download OxCal
oxcal_configure()
#> OxCal binary found at /tmp/RtmpDY8HDa/OxCal/bin/OxCalLinux
## Read OxCal script from Bosch et al. 2015
path <- system.file("oxcal/ksarakil/ksarakil.oxcal", package = "ArchaeoData")
scr <- readLines(path)

## Print script
# cat(scr, sep = "\n")

## Execute OxCal script
## /!\ this may take a while /!\
out <- oxcal_execute(scr)
#> OxCal v4.4.4 (c) Bronk Ramsey (2021)
#> MCMC analysis
#> Sort Burn    Trial   Save    Shrink  kPasses Done    Ok  Convergence
#> [.]  [.] [.] [.]     3.0 10.0    100.0   100.0
#> [.]  [.] [.] [.]     6.0 20.0    100.0   6.8
#> [.]  [.] [.] [.]     12.0    22.2    100.0   14.4
#> [.]  [.] [.] [.]     24.0    22.2    100.0   6.2
#> [.]  [.] [.] [.]     48.0    22.2    100.0   43.2
#> [.]  [.] [.] [.] [.] 96.0    22.2    100.0   64.5
#> [.]  [.] [.] [.]     192.0   22.2    100.0   80.3
#> [.]  [.] [.] [.]     384.0   22.2    100.0   83.2
#> [.]  [.] [.] [.]     768.0   22.2    100.0   70.5
#> [.]  [.] [.] [.]     1152.0  30.0    100.0   95.8
#> [.]  [.] [.] [.]     1536.0  40.0    100.0   85.1
#> [.]  [.] [.] [.]     1920.0  50.0    100.0   85.1
#> [.]  [.] [.] [.]     2304.0  60.0    100.0   85.1
#> [.]  [.] [.] [.]     2688.0  70.0    100.0   85.1
#> [.]  [.] [.] [.]     3072.0  80.0    100.0   85.1
#> [.]  [.] [.] [.]     3456.0  90.0    100.0   85.1
#> [.]  [.] [.] [.]     3840.0  100.0   100.0   82.4
#> [.]  [.] [.] [.]     4224.0  110.0   100.0   82.4

## Parse OxCal output
res <- oxcal_parse(out)
par(mar = c(5, 6, 1, 1) + 0.1)
plot(res)
plot of chunk plot

plot of chunk plot

References

Bronk Ramsey, Christopher. 2009. “Bayesian Analysis of Radiocarbon Dates.” Radiocarbon 51 (1): 337–60. https://doi.org/10.1017/S0033822200033865.