Skip to contents

Execute an Oxcal Script

Usage

oxcal_execute(
  script,
  file = NULL,
  mcmc = "MCMC_Sample",
  verbose = getOption("ArchaeoCal.verbose"),
  ...
)

Arguments

script

A character string of instructions for OxCal.

file

A character string naming a file (without extension) to write script to. Output files will be named after file and written to the same directory.

mcmc

A character string giving the name of the output file for the MCMC samples (without extension). It must match the Name argument of OxCal's MCMC_Sample() function. Only used if script contains the MCMC_Sample() command.

verbose

A logical scalar: should status updates be displayed?

...

Further parameters to be passed to system2().

Value

A list with class OxCalOutput containing the following elements:

oxcal

A character string giving the path to the .oxcal file.

js

A character string giving the path to the .js file.

log

A character string giving the path to the .log file.

txt

A character string giving the path to the .txt file.

csv

A character string giving the path to the .csv file.

See also

Author

N. Frerebeau

Examples

if (FALSE) { # \dontrun{
## 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)
} # }