Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

distNodes

Finding distance between nodes and tips


Description

The function computes the distance between pairs of nodes, pairs of tips, or between nodes and tips. The distance is meant as both patristic distance and the number of nodes intervening between the pair.

Usage

distNodes(tree,node=NULL,clus=0.5)

Arguments

tree

a phylogenetic tree. The tree needs not to be ultrametric and fully dichotomous.

node

either a single node/tip or a pair of nodes/tips.

clus

the proportion of clusters to be used in parallel computing. To run the single-threaded version of distNodes set clus = 0.

Value

If node is specified, the function returns a data frame with distances between the focal node/tip and the other nodes/tips on the tree (or for the selected pair only). Otherwise, the function returns a matrix containing the number of nodes intervening between each pair of nodes and tips.

Author(s)

Pasquale Raia, Silvia Castiglione, Carmela Serio, Alessandro Mondanaro, Marina Melchionna, Mirko Di Febbraro, Antonio Profico, Francesco Carotenuto

Examples

data("DataApes")
DataApes$Tstage->Tstage

cc<- 2/parallel::detectCores()
distNodes(tree=Tstage,clus=cc)
distNodes(tree=Tstage,node=64,clus=cc)
distNodes(tree=Tstage,node="Tro_2",clus=cc)
distNodes(tree=Tstage,node=c(64,48),clus=cc)
distNodes(tree=Tstage,node=c(64,"Tro_2"),clus=cc)

RRphylo

Phylogenetic Ridge Regression Methods for Comparative Studies

v2.5.0
GPL-2
Authors
Pasquale Raia, Silvia Castiglione, Carmela Serio, Alessandro Mondanaro, Marina Melchionna, Mirko Di Febbraro, Antonio Profico, Francesco Carotenuto
Initial release
2020-12-03

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.