tax_range_strat {palaeoverse} | R Documentation |
Generate a stratigraphic section plot
Description
A function to plot the stratigraphic ranges of fossil taxa from occurrence data.
Usage
tax_range_strat(
occdf,
name = "genus",
level = "bed",
certainty = NULL,
by = "FAD",
plot_args = NULL,
x_args = NULL,
y_args = NULL
)
Arguments
occdf |
|
name |
|
level |
|
certainty |
|
by |
|
plot_args |
A list of optional arguments that are passed directly to
|
x_args |
A list of optional arguments that are passed directly to
|
y_args |
A list of optional arguments that are passed directly to
|
Details
Note that the default spacing for the x-axis title may cause it to
overlap with the x-axis tick labels. To avoid this, you can call
graphics::title()
after running tax_range_strat()
and specify both
xlab
and line
to add the x-axis title farther from the axis (see
examples).
The styling of the points and line segments can be adjusted by supplying
named arguments to plot_args
. col
(segment and point color), lwd
(segment width), pch
(point symbol), bg
(background point color for
some values of pch
), lty
(segment line type), and cex
(point size)
are supported. In the case of a column being supplied to the certainty
argument, these arguments may be vectors of length two, in which case the
first value of the vector will be used for the "certain" points and
segments, and the second value of the vector will be used for the
"uncertain" points and segments. If only a single value is supplied, it
will be used for both. The default values for these arguments are as
follows:
-
col
=c("black", "black")
-
lwd
=c(1.5, 1.5)
-
pch
=c(19, 21)
-
bg
=c("black", "white")
-
lty
=c(1, 2)
-
cex
=c(1, 1)
Value
Invisibly returns a data.frame of the calculated taxonomic stratigraphic ranges.
The function is usually used for its side effect, which is to create a plot showing the stratigraphic ranges of taxa in a section, with levels at which the taxon was sampled indicated with a point.
Developer(s)
Bethany Allen, William Gearty & Alexander Dunhill
Reviewer(s)
William Gearty & Lewis A. Jones
Examples
# Load tetrapod dataset
data(tetrapods)
# Sample tetrapod occurrences
tetrapod_names <- tetrapods$accepted_name[1:50]
# Simulate bed numbers
beds_sampled <- sample.int(n = 10, size = 50, replace = TRUE)
# Simulate certainty values
certainty_sampled <- sample(x = 0:1, size = 50, replace = TRUE)
# Combine into data frame
occdf <- data.frame(taxon = tetrapod_names,
bed = beds_sampled,
certainty = certainty_sampled)
# Plot stratigraphic ranges
par(mar = c(12, 5, 2, 2))
tax_range_strat(occdf, name = "taxon")
tax_range_strat(occdf, name = "taxon", certainty = "certainty",
plot_args = list(ylab = "Stratigraphic height (m)"))
# Plot stratigraphic ranges with more labelling
tax_range_strat(occdf, name = "taxon", certainty = "certainty", by = "name",
plot_args = list(main = "Section A",
ylab = "Stratigraphic height (m)"))
eras_custom <- data.frame(name = c("Mesozoic", "Cenozoic"),
max_age = c(0.5, 3.5),
min_age = c(3.5, 10.5),
color = c("#67C5CA", "#F2F91D"))
axis_geo(side = 4, intervals = eras_custom, tick_labels = FALSE)
title(xlab = "Taxon", line = 10.5)