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 |
The function jack-knifes the terminals and calculates the indices value m (=replicates) times.
Best.Index(tree = tree, distribution = distribution, jtip = jtip, replicates = replicates, success = c(success))
Best.Index(tree = tree, distribution = distribution, jtip = jtip, replicates = replicates, success = c(success))
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. |
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))
Miranda-Esquivel Daniel R.
library(jrich) data(tree) data(distribution) Best.Index(tree = tree, distribution = distribution, jtip =0.5, replicates =10, success=1)
library(jrich) data(tree) data(distribution) Best.Index(tree = tree, distribution = distribution, jtip =0.5, replicates =10, success=1)
The funtion calculates standard and terminal jack-knifed indices I and W [see Miranda-Esquivel 2016], along with Posadas et al. (2001) modifications.
Calculate.Index(tree = tree, distribution = distribution, jtip = 0, verbose = TRUE, standard = "distribution")
Calculate.Index(tree = tree, distribution = distribution, jtip = 0, verbose = TRUE, standard = "distribution")
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. |
Miranda-Esquivel Daniel R.
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")
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")
Get the children of an internal node in a tree.
Children(tree = tree, node = node)
Children(tree = tree, node = node)
tree |
is a single tree with n terminals, an ape phylo object. |
node |
representing the node in APE notation, an integer. |
The children nodes of the internal node; in most cases, two integers.
Miranda-Esquivel Daniel R.
library(jrich) data(tree) Children(tree,node=7)
library(jrich) data(tree) Children(tree,node=7)
A data frame with five species distributions in eight areas, following Miranda-Esquivel (2016).
distribution
distribution
A data.frame object with eight areas (columns) and five species (rows)
Miranda-Esquivel Daniel R.
This function assigns the same weight to sister clades [1]. The input tree is reordered in post order.
IndexI(tree = tree)
IndexI(tree = tree)
tree |
is a single tree with n terminals, a phylo object. |
Returns a vector with weights.
Miranda-Esquivel Daniel R.
[1] Van-Wright et al., 1991. What to Protect? Systematics and the Agony of Choice. Biological Conservation 55 (1991) 235-254
library(jrich) data(tree) plot(tree) indexi <- IndexI(tree) newTree <- tree newTree$tip.label <- indexi plot(newTree)
library(jrich) data(tree) plot(tree) indexi <- IndexI(tree) newTree <- tree newTree$tip.label <- indexi plot(newTree)
This function assigns the weights according to the ramification pattern [1]. The input tree is reordered in post order. Returns a vector with weights.
IndexW(tree = tree)
IndexW(tree = tree)
tree |
is a single tree with n terminals, an ape phylo object. |
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
library(jrich) data(tree) plot(tree) indexw <- IndexW(tree) newTree <- tree newTree$tip.label <- indexw plot(newTree)
library(jrich) data(tree) plot(tree) indexw <- IndexW(tree) newTree <- tree newTree$tip.label <- indexw plot(newTree)
The function calculates the indices values for a MultiData list one time.
Multi.Index.Calc(MultiData = MultiData, jtip = 0, jtopol = 0)
Multi.Index.Calc(MultiData = MultiData, jtip = 0, jtopol = 0)
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). |
Returns the indices values.
Miranda-Esquivel Daniel R.
## get the library library(jrich) ## load the data data(Multitaxon1) Multi.Index.Calc(Multitaxon1, jtip = 0, jtopol = 0)
## get the library library(jrich) ## load the data data(Multitaxon1) Multi.Index.Calc(Multitaxon1, jtip = 0, jtopol = 0)
The function calculates the indices values for a MultiData list m (=replicates) times
Multi.Jack(MultiData = MultiData, times = 100, jtip = 0, jtopol = 0)
Multi.Jack(MultiData = MultiData, times = 100, jtip = 0, jtopol = 0)
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). |
Miranda-Esquivel Daniel R.
## get the library library(jrich) ## load the data data(Multitaxon1) Multi.Jack(Multitaxon1, jtip=0.25)
## get the library library(jrich) ## load the data data(Multitaxon1) Multi.Jack(Multitaxon1, jtip=0.25)
A multitaxon example with two hypothetical taxa / distributions
Multitaxon1
Multitaxon1
A list with two objects, each with an APE object, class phylo and the distribution of the terminals.
Miranda-Esquivel Daniel R.
Renk indices according to the areas' absolute position. If the index value is empty, the function assigns a dummy position "X0X"
Rank.Indices(index.Value = index.Value)
Rank.Indices(index.Value = index.Value)
index.Value |
a table with indices values. |
a table with the decreasing order of the areas It presents the ties alphabetically
Miranda-Esquivel Daniel R.
## get the library library(jrich) ## load the data data(tree) data(distribution) Rank.Indices(Calculate.Index(tree=tree, distrib = distribution, verbose=FALSE))
## get the library library(jrich) ## load the data data(tree) data(distribution) Rank.Indices(Calculate.Index(tree=tree, distrib = distribution, verbose=FALSE))
Read distributions as a csv with two columns labeled "species" and "area"
Read.Data(data.File)
Read.Data(data.File)
data.File |
a csv file to read, with two columns labeled "species" and "area" |
a data.frame object with the distribution by species
Miranda-Esquivel Daniel R.
You input two tables with indices and it function returns a single table with the sum.
Sum.Indices.2.Topologies(indices1 = indices1, indices2 = indices2)
Sum.Indices.2.Topologies(indices1 = indices1, indices2 = indices2)
indices1 |
a table of indices values. |
indices2 |
a table of indices values. |
a single table with the sum of the two indices.
Miranda-Esquivel Daniel R.
## 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)
## 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 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).
taxon1
taxon1
A list with two objects
Miranda-Esquivel Daniel R.
A tree as an APE object with five terminals, following Miranda-Esquivel (2016).
tree
tree
An APE object, class phylo. A tree dataset with five terminals.
Miranda-Esquivel Daniel R.