threshold_ranges: threshold_ranges

Description Usage Arguments Value

View source: R/threshold_ranges.R

Description

Function to detect if two peaks in a density spectrum can be considered separate based on a user supplied threshold. Creates a sequence of divisions from the troughs immediately preceding any significant peaks, then bins occurrences for a given taxon name by those divisions.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
threshold_ranges(
  x,
  rank = "genus",
  srt = "max_ma",
  end = "min_ma",
  method = "kernel",
  step = 1,
  density = 0.1,
  use_sd = TRUE,
  win = 5,
  thresh = 5,
  ...,
  report = TRUE,
  verbose = TRUE
)

Arguments

x

An occurrence dataset containing taxon names, maximum ages and minimum ages

rank

The column name in x containing the taxon names

srt

A column name in x denoting the occurrence maximum ages

end

A column name in x denoting the occurrence minumum ages

method

The method for quantifying occurrence density: one histogram or kernel. Kernel is the recommended default. As called be @seealso densify

step

A positive integer specifying the time window size for density calculation. As called by @seealso densify

density

A positive numeric specifying the step size for densifying records. This should ideally be smaller than step. As called by @seealso densify

use_sd

A logical determining whether to use peaks detected as significant using the mean + standard deviation of its neighbourhood. If FALSE, then the peaks need only be greater than the neighbourhood mean to be significant. Thus, use_sd is more conservative, but less prone to noise. As called by @seealso find_peaks

win

A positive integer specifying the neighborhood window length on either side of a peak durign significance testing (i.e. win 5 will give a total window of 11: -5 indices + peak index + 5 indices). As called by @seealso find_peaks

thresh

The threshold distance between peaks above which they will be considered distinct - given in Ma

...

additional arguments passed to @seealso density

report

A logical determining if the analytical outputs of the function be returned to the user, as well as the revised taxon names, TRUE by default

verbose

A logical determining if function progress should be reported

Value

If report = TRUE (the default), a list of five elements. $data gives the thresholded (and potentially subdivided) taxon names. $matrix is the taxon-wise matrix of occurrence densities. $peaks is a list containing three lists of peaks (all peaks, significant by mean + sd, significant by sd only) for each taxon and a dataframe of peak counts between the three treatments. $comparison


jf15558/FAU.JFS documentation built on Jan. 21, 2022, 6:52 a.m.