Learn R Programming

divDyn (version 0.7.1)

fadlad: FAD - LAD matrix from occurrence data

Description

Function to generate range data from an occurrence dataset.

Usage

fadlad(dat, tax, bin, ages = FALSE, na.rm = TRUE, zerodur = TRUE)

Arguments

dat

(data.frame): Occurrence data.

tax

(character): The column name of taxon names.

bin

(character): The column name of bin variable. If two column names are entered, then they will interpreted as the minimum and maximum age uncertainty. (see examples)

ages

(logical): Are the bin entries ages (reversed time axis)? Setting ages to TRUE will replace the entries in 'bin' column(s) with their additive inverses.

na.rm

(logical): Should taxa that have no valid FADs or LADs (due to only NA entries) be removed from the output?

zerodur

(logical): If set to TRUE, single-interval taxa will 0 durations. Setting this argument to FALSE will add 1 to the durations of all taxa, which can be useful for binned data.

Details

The function will output First and Last Appearance Data of the taxa in the dataset. Keep in mind that incomplete sampling will influence these data and will make the ranges appear shrunken.

The following variables are produced:

attribute row.names: The names of the taxa.

FAD: First appearance data, given in time slice numbers.

LAD: Last appearance data, given in time slice numbers.

duration: optionally, the duration of taxa in numeric ages. It is given for single-interval taxa as well assuming that the taxa's range span over the entire time slice.

Examples

Run this code
# NOT RUN {
data(corals)

# binned data
  flBinned <- fadlad(corals, tax="genus", bin="stg")

# using basic bin lengths
  flDual <- fadlad(corals, tax="genus", bin=c("max_ma", "min_ma"), ages=TRUE)

# single age esimate 
  data(stages)
  corals$mid <- stages$mid[corals$stg]
  flSingle <- fadlad(corals, tax="genus", bin="mid", ages=TRUE)


# }

Run the code above in your browser using DataLab