| Title: | An R Interface to 'OxCal' |
|---|---|
| Description: | What the package does (one paragraph). |
| Authors: | Nicolas Frerebeau [aut, cre] (ORCID: <https://orcid.org/0000-0001-5759-4944>) |
| Maintainer: | Nicolas Frerebeau <[email protected]> |
| License: | GPL (>= 3) |
| Version: | 0.0.0.9000 |
| Built: | 2026-05-12 08:37:15 UTC |
| Source: | https://github.com/ArchaeoStat/ArchaeoCal |
Coerce to a Data Frame
## S3 method for class 'OxCalResults' as.data.frame(x, row.names = NULL, optional = FALSE, ...)## S3 method for class 'OxCalResults' as.data.frame(x, row.names = NULL, optional = FALSE, ...)
x |
A |
row.names |
A |
optional |
A |
... |
Currently not used. |
A data.frame with the following columns:
nameoperationtypedateerroragreementconvergencelike_rangeA list giving the confidence intervals of the likelihood.
like_densityA list giving the likelihood.
post_rangeA list giving the confidence intervals of the posterior probability.
post_densityA list giving the posterior probability.
14C Calibration with OxCal
oxcal_calibrate(names, dates, errors, curve = "IntCal20")oxcal_calibrate(names, dates, errors, curve = "IntCal20")
names |
A |
dates |
A |
errors |
A |
curve |
A |
A list with class OxCalResults (see oxcal_parse()).
N. Frerebeau
## Not run: ## Download OxCal oxcal_configure() ## Calibrate 14C dates cal <- oxcal_calibrate( names = c("X","Y"), dates = c(5000, 4500), errors = c(45, 35) ) as.data.frame(cal) ## End(Not run)## Not run: ## Download OxCal oxcal_configure() ## Calibrate 14C dates cal <- oxcal_calibrate( names = c("X","Y"), dates = c(5000, 4500), errors = c(45, 35) ) as.data.frame(cal) ## End(Not run)
Configure OxCal
oxcal_configure( path = oxcal_path(), os = NULL, install = TRUE, ask = interactive(), force = FALSE, verbose = getOption("ArchaeoCal.verbose"), ... )oxcal_configure( path = oxcal_path(), os = NULL, install = TRUE, ask = interactive(), force = FALSE, verbose = getOption("ArchaeoCal.verbose"), ... )
path |
A |
os |
A |
install |
A |
ask |
A |
force |
A |
verbose |
A |
... |
Further arguments to be passed to |
Downloads the latest version of Oxcal (if needed) and sets the executable path correctly.
oxcal_configure() is called for its side-effect.
Invisibly returns the path to the OxCal executable.
N. Frerebeau
## Not run: ## Download OxCal oxcal_configure() ## Custom script scr <- 'Plot() { Sequence("Sequence1") { Boundary("Begin"); Phase("Phase1") { R_Date("Lab-1",5000,25); R_Date("Lab-2",4900,37); }; Boundary("Between"); Phase("Phase2") { R_Date("Lab-3",4800,43); }; Boundary("End"); }; };' out <- oxcal_execute(scr) res <- oxcal_parse(out) as.data.frame(res) ## End(Not run)## Not run: ## Download OxCal oxcal_configure() ## Custom script scr <- 'Plot() { Sequence("Sequence1") { Boundary("Begin"); Phase("Phase1") { R_Date("Lab-1",5000,25); R_Date("Lab-2",4900,37); }; Boundary("Between"); Phase("Phase2") { R_Date("Lab-3",4800,43); }; Boundary("End"); }; };' out <- oxcal_execute(scr) res <- oxcal_parse(out) as.data.frame(res) ## End(Not run)
Execute an Oxcal Script
oxcal_execute( script, file, path = oxcal_path(), mcmc = NULL, verbose = getOption("ArchaeoCal.verbose"), ... )oxcal_execute( script, file, path = oxcal_path(), mcmc = NULL, verbose = getOption("ArchaeoCal.verbose"), ... )
script |
A |
file |
A |
path |
A |
mcmc |
A |
verbose |
A |
... |
Further parameters to be passed to |
A list with class OxCalOutput containing the following elements:
oxcalA character string giving the path to the .oxcal file.
jsA character string giving the path to the .js file.
logA character string giving the path to the .log file.
txtA character string giving the path to the .txt file.
csvA character string giving the path to the .csv file.
N. Frerebeau
https://c14.arch.ox.ac.uk/oxcalhelp/hlp_analysis_file.html
## Not run: ## Download OxCal oxcal_configure() ## Custom script scr <- 'Plot() { Sequence("Sequence1") { Boundary("Begin"); Phase("Phase1") { R_Date("Lab-1",5000,25); R_Date("Lab-2",4900,37); }; Boundary("Between"); Phase("Phase2") { R_Date("Lab-3",4800,43); }; Boundary("End"); }; };' out <- oxcal_execute(scr) res <- oxcal_parse(out) as.data.frame(res) ## End(Not run)## Not run: ## Download OxCal oxcal_configure() ## Custom script scr <- 'Plot() { Sequence("Sequence1") { Boundary("Begin"); Phase("Phase1") { R_Date("Lab-1",5000,25); R_Date("Lab-2",4900,37); }; Boundary("Between"); Phase("Phase2") { R_Date("Lab-3",4800,43); }; Boundary("End"); }; };' out <- oxcal_execute(scr) res <- oxcal_parse(out) as.data.frame(res) ## End(Not run)
Download and Install OxCal
oxcal_install( target, source = "https://c14.arch.ox.ac.uk/OxCalDistribution.zip", verbose = getOption("ArchaeoCal.verbose"), ... )oxcal_install( target, source = "https://c14.arch.ox.ac.uk/OxCalDistribution.zip", verbose = getOption("ArchaeoCal.verbose"), ... )
target |
A |
source |
A |
verbose |
A |
... |
Currently not used. |
oxcal_install() is called for its side-effect.
Invisibly returns the path to the OxCal directory.
N. Frerebeau
## Not run: ## Download OxCal oxcal_configure() ## Custom script scr <- 'Plot() { Sequence("Sequence1") { Boundary("Begin"); Phase("Phase1") { R_Date("Lab-1",5000,25); R_Date("Lab-2",4900,37); }; Boundary("Between"); Phase("Phase2") { R_Date("Lab-3",4800,43); }; Boundary("End"); }; };' out <- oxcal_execute(scr) res <- oxcal_parse(out) as.data.frame(res) ## End(Not run)## Not run: ## Download OxCal oxcal_configure() ## Custom script scr <- 'Plot() { Sequence("Sequence1") { Boundary("Begin"); Phase("Phase1") { R_Date("Lab-1",5000,25); R_Date("Lab-2",4900,37); }; Boundary("Between"); Phase("Phase2") { R_Date("Lab-3",4800,43); }; Boundary("End"); }; };' out <- oxcal_execute(scr) res <- oxcal_parse(out) as.data.frame(res) ## End(Not run)
Read and Parse OxCal Output
oxcal_parse(path) ## S3 method for class 'OxCalOutput' oxcal_parse(path)oxcal_parse(path) ## S3 method for class 'OxCalOutput' oxcal_parse(path)
path |
A |
A list with class OxCalResults containing the following elements:
ocdA list of OxCal data which holds the ranges, probability
distributions, etc. for each parameter.
modelA list of information about the model.
calibA list of information about the calibration curve.
N. Frerebeau
https://c14.arch.ox.ac.uk/oxcalhelp/hlp_analysis_file.html
## Not run: ## Download OxCal oxcal_configure() ## Custom script scr <- 'Plot() { Sequence("Sequence1") { Boundary("Begin"); Phase("Phase1") { R_Date("Lab-1",5000,25); R_Date("Lab-2",4900,37); }; Boundary("Between"); Phase("Phase2") { R_Date("Lab-3",4800,43); }; Boundary("End"); }; };' out <- oxcal_execute(scr) res <- oxcal_parse(out) as.data.frame(res) ## End(Not run)## Not run: ## Download OxCal oxcal_configure() ## Custom script scr <- 'Plot() { Sequence("Sequence1") { Boundary("Begin"); Phase("Phase1") { R_Date("Lab-1",5000,25); R_Date("Lab-2",4900,37); }; Boundary("Between"); Phase("Phase2") { R_Date("Lab-3",4800,43); }; Boundary("End"); }; };' out <- oxcal_execute(scr) res <- oxcal_parse(out) as.data.frame(res) ## End(Not run)
Get OxCal Executable Path
oxcal_path(...)oxcal_path(...)
... |
Currently not used. |
Defaults to the R user directory.
A character string giving the path to OxCal executable.
N. Frerebeau
## Not run: ## Download OxCal oxcal_configure() ## Custom script scr <- 'Plot() { Sequence("Sequence1") { Boundary("Begin"); Phase("Phase1") { R_Date("Lab-1",5000,25); R_Date("Lab-2",4900,37); }; Boundary("Between"); Phase("Phase2") { R_Date("Lab-3",4800,43); }; Boundary("End"); }; };' out <- oxcal_execute(scr) res <- oxcal_parse(out) as.data.frame(res) ## End(Not run)## Not run: ## Download OxCal oxcal_configure() ## Custom script scr <- 'Plot() { Sequence("Sequence1") { Boundary("Begin"); Phase("Phase1") { R_Date("Lab-1",5000,25); R_Date("Lab-2",4900,37); }; Boundary("Between"); Phase("Phase2") { R_Date("Lab-3",4800,43); }; Boundary("End"); }; };' out <- oxcal_execute(scr) res <- oxcal_parse(out) as.data.frame(res) ## End(Not run)