add_itp {fossilbrush}R Documentation

add_itp

Description

Function to add detected peaks using the output of

Usage

add_itp(x, taxon, legend.pos = "topright", exit = TRUE)

Arguments

x

The list output of @seealso threshold_ranges

taxon

A character vector of length one, specifying one of the taxon names in x to be plotted

legend.pos

One of topleft, bottomleft, topright or bottomright, or a vector of length two, giving the xy coordinates of the legend. A convenience parameter so that the plot detail can remain unobscured.

exit

Restore base plotting parameters on function exit (default as a requirement for CRAN). Can be set to false to allow other elements to be aded to a plot

Value

None, the detected peaks are added to an existing density plot

See Also

threshold_ranges. This function should be used to add information to an existing plot from @seealso densify, ensuring that the same taxon name is being used

Examples

# load dataset
data("brachios")
# subsample brachios to make for a short example runtime
set.seed(1)
brachios <- brachios[sample(1:nrow(brachios), 1000),]
# densify ranges
dens <- densify(brachios)
# interpeak thresholding
itp <- threshold_ranges(brachios, win = 8, thresh = 10,
                        rank = "genus", srt = "max_ma", end = "min_ma")
# append the stratigraphically thresholded taxon names to the dataset
# plot the taxon, now identifying the peaks
plot_dprofile(dens, "Atrypa", exit = FALSE)
add_itp(itp, "Atrypa")

[Package fossilbrush version 1.0.3 Index]