Skip to contents

Setup OxCal

Usage

oxcal_setup(path = NULL, os = NULL, ask = TRUE)

Arguments

path

A character string specifying the directory where to find the OxCal executable (or to extract OxCal files to).

os

A character string specifying the operating system of the workstation. It must be one of "Linux", "Windows" or "Darwin". If NULL (the default), the operating system will be determined automatically (see Sys.info()).

ask

A logical scalar: if OxCal is not installed, should the user be asked to download it? If FALSE and the OxCal executable cannot be found, will raise an error. Only used if R is being used interactively.

Value

Invisibly returns the path to the OxCal executable.

Details

Downloads the latest version of Oxcal (if needed) and sets the executable path correctly.

Note

Adapted from oxcAAR::quickSetupOxcal().

See also

Author

C. Schmid, N. Frerebeau

Examples

if (FALSE) {
## Download OxCal
oxcal_setup()

## Calibrate 14C dates
cal <- oxcal_calibrate(
  names = c("X","Y"),
  dates = c(5000, 4500),
  errors = c(45, 35)
)
plot(cal, curve = FALSE)
plot(cal, curve = TRUE)

## 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)

plot(res, curve = FALSE)
plot(res, curve = TRUE)

as.data.frame(res)
}