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(ask = FALSE)
#> Could not find OxCal binary at /tmp/RtmpCaliqV/OxCal/bin/OxCalLinux
#> Could not find OxCal binary at OxCal
#> Attempting to download OxCal from https://c14.arch.ox.ac.uk/OxCalDistribution.zip.
#> OxCal successfully downloaded and extracted to /tmp/RtmphxBObr/OxCal.
#> OxCal binary found at /tmp/RtmphxBObr/OxCal/bin/OxCalLinux
## Construct path to file
path <- file.path("oxcal", "ksarakil", "ksarakil.oxcal")
file <- system.file(path, package = "ArchaeoData")
## Read OxCal script from Bosch et al. 2015
scr <- readLines(file)
## 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 0.0
#> [.] [.] [.] [.] 12.0 22.2 100.0 4.7
#> [.] [.] [.] [.] 24.0 22.2 100.0 25.5
#> [.] [.] [.] [.] 48.0 22.2 100.0 42.5
#> [.] [.] [.] [.] [.] 96.0 22.2 100.0 59.4
#> [.] [.] [.] [.] 192.0 22.2 100.0 5.8
#> [.] [.] [.] [.] 384.0 22.2 100.0 50.7
#> [.] [.] [.] [.] 768.0 22.2 100.0 93.6
#> [.] [.] [.] [.] 1152.0 30.0 100.0 94.4
#> [.] [.] [.] [.] 1536.0 40.0 100.0 94.4
#> [.] [.] [.] [.] 1920.0 50.0 100.0 90.0
#> [.] [.] [.] [.] 2304.0 60.0 100.0 90.0
#> [.] [.] [.] [.] 2688.0 70.0 100.0 90.0
#> [.] [.] [.] [.] 3072.0 80.0 100.0 90.0
#> [.] [.] [.] [.] 3456.0 90.0 100.0 90.0
#> [.] [.] [.] [.] 3840.0 100.0 100.0 90.0
#> [.] [.] [.] [.] 4224.0 110.0 100.0 90.0
## Parse OxCal output
res <- oxcal_parse(out)
References
Bronk Ramsey, C. (2009). Bayesian Analysis of Radiocarbon Dates. Radiocarbon, 51(1): 337-360. DOI: [10.1017/S0033822200033865(https://doi.org/10.1017/S0033822200033865).