densify {fossilbrush}R Documentation

densify

Description

Function to create a matrix of occurrence record densities through geological time from an occurrence dataset. Each column represents a taxon. Each row represents a user defined window of time, with the first row starting at the oldest FAD in the dataset and spanning to the youngest LAD stepwise by the user defined window (default of 1 Ma). Occurrence records are densified by generating a vector of time points from occurrence FAD to occurrence LAD (default step of 0.1 Ma), then tallied in two ways. The first way is a simple histogram count of points-per-window, with the same number of histogram bins as time steps between the overall taxon FAD and LAD. The second way is a kernel density estimate, using a Gaussian kernel with a equally spaced estimatopms equal to the number of timesteps between the overall taxon FAD and LAD

Usage

densify(
  x,
  rank = "genus",
  srt = "max_ma",
  end = "min_ma",
  step = 1,
  density = 0.1,
  method = c("histogram", "kernel"),
  ...,
  verbose = TRUE
)

Arguments

x

An occurrence dataset

rank

The column name in x containing the taxon names for which densified columns will be generated

srt

A column name in x denoting the occurrence FADs

end

A column name in x denoting the occurrence LADs

step

A positive integer specifying the time window size (i.e. the duration represented by each row in the output matrix)

density

A positive numeric specifying the step size for densifying records. This should ideally be smaller than step

method

The method for quantifying occurrence density. By default both histogram and kernel density will be used

...

additional arguments passed to @seealso density

verbose

A logical determining if function progress should be reported

Value

A list of two sparse matrices, the first containing the histogram counts, the second the kernel density estimates

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)

[Package fossilbrush version 1.0.5 Index]