checktree: Check Trait and Phylo Data

View source: R/checktree.R

checktreeR Documentation

Check Trait and Phylo Data

Description

Checks consistency of names of species in spatial, phylogenetic and traits data.

Usage

  checktree(tree,  mippp, idar, correct.phylo)
  checktraits(traits, mippp, idar, correct.trait.na, correct.trait)
  

Arguments

tree

A phylogenetic tree in phylo format (ape) or a phylogenetic covariance matrix

traits

A data.frame of traits, or a distance matrix among species (in dist or matrix format) computed on a data.frame of traits.

mippp

A multitype (a.k.a. multivariate) marked point pattern . An object with the ppp format of spatstat, with the names of species as marks.

idar

Character. The name of the idar fucntion to be computed. Either "isar", "ipsvar", "ipsrar", "ipsear", "ipscar", or "imntdar"

correct.phylo

Character. Either "mean" meaning "include missing species in the tree with a constant mean phylogenetic covariance" or "exclude", meaning "exclude missing species in the tree from the analysis"

correct.trait.na

Logical flag indicating whether NA values in the matrix of traits should be "corrected": NA values will be assigned the mean trait value.

correct.trait

Character. Either "mean" or "exclude". Species missing in the data.frame of traits will be assigned mean trait values or will be excluded from the analysis, respectively.

Details

This functions check for the coincidence of species in the point pattern and in the phylogenetic or trait data and for the existence of missing data. If correct.phylo="mean", species which are absent in the phylogenetic tree or covariance matrix will be included and assigned mean phylogenetic covariance. If correct.phylo="exclude", missing species in the tree will be excluded from the analysis (i.e., will not be considered in the computation of the local phylogenetic indices). If correct.trait.na="TRUE", NA values for traits in the data.frame of traits will be assigned the mean trait value. If correct.trait="mean", missing species in the data.frame of traits will be included and assigned mean trait values. If correct.trait="exclude", missing species in the data.frame of traits will be excluded from the analysis (i.e., will not be considered in the computation of the local functional indices).

Value

checktree returns a covariance matrix with the appropriate species corrections. checktraits returns a data.frame of traits with the appropriate corrections or a Gower distance matrix among the species from the corrected data.frame of traits if idar="ifdar".

Warning

The transcription of species names in the multivariate mippp, in the row names of the data.frame of traits (or in the names or dimnames of the distance matrices) should be identical. The same applies to the tiplabels of the phylogenetic tree.

Author(s)

Marcelino de la Cruz marcelino.delacruz@urjc.es


idar documentation built on Jan. 5, 2023, 5:10 p.m.

Related to checktree in idar...