Package 'jrich'

Title: Jack-Knife Support for Evolutionary Distinctiveness Indices I and W
Description: These functions calculate the taxonomic measures presented in Miranda-Esquivel (2016). The package introduces Jack-knife resampling in evolutionary distinctiveness prioritization analysis, as a way to evaluate the support of the ranking in area prioritization, and the persistence of a given area in a conservation analysis. The algorithm is described in: Miranda-Esquivel, D (2016) <DOI:10.1007/978-3-319-22461-9_11>.
Authors: Daniel R. Miranda-Esquivel
Maintainer: Daniel R. Miranda-Esquivel <[email protected]>
License: GPL-3
Version: 0.60-36.02
Built: 2024-11-22 04:05:50 UTC
Source: https://github.com/dmirandae/jrich

Help Index


Jack-knife indices in a single topology m times and evaluates a success rule.

Description

The function jack-knifes the terminals and calculates the indices value m (=replicates) times.

Usage

Best.Index(tree = tree, distribution = distribution, jtip = jtip,
  replicates = replicates, success = c(success))

Arguments

tree

is a single tree with n terminals, an ape phylo object.

distribution

species distributions in n areas, a data.frame

jtip

is the proportion of terminals to delete, real (range 0-1).

replicates

is the number of replicates, an integer.

success

the measure of the success, a vector.

Value

The function returns the success that correspond to obtain the same ranking for X,Y positions, established as the vector success (by default success)).

The function returns the success that corresponds to obtain the same ranking for X,Y positions, established as the vector success (by default success))

Author(s)

Miranda-Esquivel Daniel R.

Examples

library(jrich)
data(tree)
data(distribution)

Best.Index(tree = tree, distribution = distribution, jtip =0.5, replicates =10, success=1)

Indices values and Jack-knife indices for a single topology.

Description

The funtion calculates standard and terminal jack-knifed indices I and W [see Miranda-Esquivel 2016], along with Posadas et al. (2001) modifications.

Usage

Calculate.Index(tree = tree, distribution = distribution, jtip = 0,
  verbose = TRUE, standard = "distribution")

Arguments

tree

is a single tree with n terminals, an ape phylo object.

distribution

species distributions in m areas, a data.frame

jtip

is the proportion of terminals to delete, real (range 0-1).

verbose

Boolean. If TRUE, the output reports the number of deleted terminals/topologies.

standard

"distribution" or "tree" to standarize by the by the sum of indices in the distribution or the sum of indices in the tree.

Author(s)

Miranda-Esquivel Daniel R.

Examples

library(jrich)

data(tree)
data(distribution)

## Standarized by the sum of indices in the distribution
Calculate.Index(tree=tree, distribution = distribution, verbose=TRUE, standard = "distribution")

## Standarized by the sum of indices in the tree (as figure 1 in Miranda-Esquivel 2016)
Calculate.Index(tree=tree, distribution = distribution, verbose=TRUE, standard = "tree")

Children of an internal node.

Description

Get the children of an internal node in a tree.

Usage

Children(tree = tree, node = node)

Arguments

tree

is a single tree with n terminals, an ape phylo object.

node

representing the node in APE notation, an integer.

Value

The children nodes of the internal node; in most cases, two integers.

Author(s)

Miranda-Esquivel Daniel R.

Examples

library(jrich)
 
 data(tree)

Children(tree,node=7)

Distribution of five taxa.

Description

A data frame with five species distributions in eight areas, following Miranda-Esquivel (2016).

Usage

distribution

Format

A data.frame object with eight areas (columns) and five species (rows)

Author(s)

Miranda-Esquivel Daniel R.


I index value for a single topology.

Description

This function assigns the same weight to sister clades [1]. The input tree is reordered in post order.

Usage

IndexI(tree = tree)

Arguments

tree

is a single tree with n terminals, a phylo object.

Value

Returns a vector with weights.

Author(s)

Miranda-Esquivel Daniel R.

References

[1] Van-Wright et al., 1991. What to Protect? Systematics and the Agony of Choice. Biological Conservation 55 (1991) 235-254

Examples

library(jrich)
 data(tree)
 plot(tree)
 indexi               <- IndexI(tree)
 newTree              <- tree
 newTree$tip.label    <- indexi
 plot(newTree)

W index value for a single topology.

Description

This function assigns the weights according to the ramification pattern [1]. The input tree is reordered in post order. Returns a vector with weights.

Usage

IndexW(tree = tree)

Arguments

tree

is a single tree with n terminals, an ape phylo object.

Author(s)

Miranda-Esquivel Daniel R.

#'@references [1] Van-Wright et al., 1991. What to Protect? Systematics and the Agony of Choice. Biological Conservation 55 (1991) 235-254

Examples

library(jrich)
  data(tree)
  plot(tree)
  indexw             <- IndexW(tree)
  newTree            <- tree
  newTree$tip.label  <- indexw
  plot(newTree)

Jack-knife indices in n topologies one time.

Description

The function calculates the indices values for a MultiData list one time.

Usage

Multi.Index.Calc(MultiData = MultiData, jtip = 0, jtopol = 0)

Arguments

MultiData

is the list of Trees and distributions to evaluate, a list object.

jtip

is the proportion of terminals to delete, real (range 0-1).

jtopol

is the proportion of topologies to delete, real (range 0-1).

Value

Returns the indices values.

Author(s)

Miranda-Esquivel Daniel R.

Examples

## get the library
 library(jrich)
 
 ## load the data
 data(Multitaxon1) 

 Multi.Index.Calc(Multitaxon1, jtip = 0, jtopol = 0)

Jack-knife indices in n topologies m times.

Description

The function calculates the indices values for a MultiData list m (=replicates) times

Usage

Multi.Jack(MultiData = MultiData, times = 100, jtip = 0, jtopol = 0)

Arguments

MultiData

is the list of Trees and distributions to evaluate, a list object.

times

in the number of times to repeat the process, an integer.

jtip

is the proportion of terminals to delete, real (range 0-1).

jtopol

is the proportion of topologies to delete, real (range 0-1).

Author(s)

Miranda-Esquivel Daniel R.

Examples

## get the library
 library(jrich)
 
 ## load the data
 data(Multitaxon1) 

Multi.Jack(Multitaxon1, jtip=0.25)

Multitaxon example.

Description

A multitaxon example with two hypothetical taxa / distributions

Usage

Multitaxon1

Format

A list with two objects, each with an APE object, class phylo and the distribution of the terminals.

Author(s)

Miranda-Esquivel Daniel R.


Rank indices.

Description

Renk indices according to the areas' absolute position. If the index value is empty, the function assigns a dummy position "X0X"

Usage

Rank.Indices(index.Value = index.Value)

Arguments

index.Value

a table with indices values.

Value

a table with the decreasing order of the areas It presents the ties alphabetically

Author(s)

Miranda-Esquivel Daniel R.

Examples

## get the library
 library(jrich)
 
 ## load the data
 data(tree) 
 data(distribution) 
 
Rank.Indices(Calculate.Index(tree=tree, distrib = distribution, verbose=FALSE))

Read distributions.

Description

Read distributions as a csv with two columns labeled "species" and "area"

Usage

Read.Data(data.File)

Arguments

data.File

a csv file to read, with two columns labeled "species" and "area"

Value

a data.frame object with the distribution by species

Author(s)

Miranda-Esquivel Daniel R.


Sums two tables with indices values.

Description

You input two tables with indices and it function returns a single table with the sum.

Usage

Sum.Indices.2.Topologies(indices1 = indices1, indices2 = indices2)

Arguments

indices1

a table of indices values.

indices2

a table of indices values.

Value

a single table with the sum of the two indices.

Author(s)

Miranda-Esquivel Daniel R.

Examples

## get the library
 library(jrich)
 
 ## load the data
 data(Multitaxon1) 
 
 ## calculate indices for two trees and their distributions
 temp.Index.Value1 <- Calculate.Index(tree = Multitaxon1[[1]][[1]],
                                      distribution = Multitaxon1[[1]][[2]],0)

 temp.Index.Value2 <- Calculate.Index(tree = Multitaxon1[[2]][[1]],
                                      distribution = Multitaxon1[[2]][[2]],0)
 
 ## sum the indices values
 Sum.Indices.2.Topologies(temp.Index.Value1, temp.Index.Value2)

A tree and the distribution of the taxa.

Description

A list with two objects: Taxon[[1]]: A tree as an APE object with five terminals and Taxon[[2]]: A data frame with five species distributions in eight areas, following Miranda-Esquivel (2016).

Usage

taxon1

Format

A list with two objects

Author(s)

Miranda-Esquivel Daniel R.


A tree with five terminals.

Description

A tree as an APE object with five terminals, following Miranda-Esquivel (2016).

Usage

tree

Format

An APE object, class phylo. A tree dataset with five terminals.

Author(s)

Miranda-Esquivel Daniel R.