Look up geological intervals and assign geological stagesSource:
A function that uses interval names to assign either international geological stages and numeric ages from the International Commission on Stratigraphy (ICS), or user-defined intervals, to fossil occurrences.
look_up( occdf, early_interval = "early_interval", late_interval = "late_interval", int_key = FALSE, assign_with_GTS = "GTS2020", return_unassigned = FALSE )
dataframe. A dataframe of fossil occurrences or other geological data, with columns of class
characterspecifying the earliest and the latest possible interval associated with each occurrence.
character. Name of the column in
occdfthat contains the earliest interval from which the occurrences are from. Defaults to "early_interval".
character. Name of the column in
occdfthat contains the latest interval from which the occurrences are from. Defaults to "late_interval".
dataframe. A dataframe linking interval names to international geological stage names from the ICS, or other, user-defined intervals. This dataframe should contain the following named columns containing
interval_namecontains the names to be matched from
early_stagecontains the names of the earliest stages corresponding to the intervals
late_stagecontains the latest stage corresponding to the intervals
numericcolumns provide maximum and minimum ages for the intervals:
If set to
FALSE(default), stages and numerical ages can be assigned based on one of the GTS tables (see below).
FALSE. Allows intervals to be searched in the
GTS2020(default) or the
GTS2012table. Set to
logical. Return interval names which could not be assigned, instead of the dataframe with assignments. Defaults to
dataframe of the original input
data with the following
appended columns is returned:
to the earliest and latest international geological stage which
could be assigned to the occurrences based on the given interval names.
interval_min_ma return maximum and minimum interval
ages if provided in the interval key, or if they can be fetched from GTS2012
or GTS2020. A column
interval_mid_ma is appended to provide the midpoint
ages of the intervals.
int_key is set to
FALSE (default), this function can be used to
assign numerical ages solely based on stages from a GTS table, and to assign
stages based on GTS interval names.
Instead of geological stages, the user can supply any names in the
late_stage column of
assign_with_GTS should then be set to
int_key has been included within this package
interval_key). This key works well for assigning
geological stages to many of the intervals from the
and the PaleoReefs Database.
palaeoverse cannot guarantee that all of
the stage assignments with the exemplary key are accurate.
The table corresponding to this key can be loaded with
## Just use GTS2020 (default): # create exemplary dataframe taxdf <- data.frame(name = c("A", "B", "C"), early_interval = c("Maastrichtian", "Campanian", "Sinemurian"), late_interval = c("Maastrichtian", "Campanian", "Bartonian")) # assign stages and numerical ages taxdf <- look_up(taxdf) ## Use exemplary int_key # Get internal reef data occdf <- reefs # assign stages and numerical ages occdf <- look_up(occdf, early_interval = "interval", late_interval = "interval", int_key = interval_key) ## Use exemplary int_key and return unassigned # Get internal tetrapod data occdf <- tetrapods # assign stages and numerical ages occdf <- look_up(occdf, int_key = palaeoverse::interval_key) #> Warning: `NA`, `""` or `" "` entries from `late_interval` have been #> filled in with the corresponding `early_interval` entries #> Warning: The following intervals could not be matched with intervals from int_key #> or GTS: Early Triassic, Late Pennsylvanian, Vokhmian # return unassigned intervals unassigned <- look_up(occdf, int_key = palaeoverse::interval_key, return_unassigned = TRUE) #> Warning: `NA`, `""` or `" "` entries from `late_interval` have been #> filled in with the corresponding `early_interval` entries ## Use own key and GTS2012: # create example data occdf <- data.frame( stage = c("any Permian", "first Permian stage", "any Permian", "Roadian")) # create example key interval_key <- data.frame( interval_name = c("any Permian", "first Permian stage"), early_stage = c("Asselian", "Asselian"), late_stage = c("Changhsingian", "Asselian")) # assign stages and numerical ages: occdf <- look_up(occdf, early_interval = "stage", late_interval = "stage", int_key = interval_key, assign_with_GTS = "GTS2012")