Create input for age models, based on the file structure and input files organisation needed.
create_input(data, wdir, entity = NULL, am = "bacon")
List with named data frames containing the input data.
sample_depths
: data frame with sampling depths information.
id
: depth ID.
depth
: depth in cm.
core
: data frame with core (entity) information.
labID
: lab ID.
age
: age in years.
error
: age uncertainty in years.
depth
: depth in cm.
(Optional) cc
: calibration curve.
cc = 1
: IntCal20
(northern hemisphere terrestrial).
cc = 2
: Marine20
(marine).
cc = 3
: SHCal20
(southern hemisphere terrestrial).
(Optional) hiatus
: data frame with information of hiatus
depths, if not passed, then an empty file is created.
id
: depth ID.
depth
: depth in cm.
Working directory, absolute or relative path.
Entity name.
Age model name.
Input files for the age model.
If only wdir
is passed, the value of entity
will be extracted
from the last portion of wdir
. For example, if
wdir = "/path/to/a"
, then entity = "a"
and
wdir = "/path/to"
. If entity = NULL
and wdir = "/"
the function will return an error message, because the path is too short.
To use the current working directory, wdir = "./"
.
test_data <-list(sample_depths = data.frame(id = 1:100,
depth =
seq(0, 500, length = 100)),
core = data.frame(labID = "RDG",
age = c(720, 2700, 4660),
error = c(70, 50, 110),
depth = c(83, 212, 418)))
if (FALSE) {
ageR::create_input(test_data, getwd(), "Reading")
}