% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/diameter.R
\name{diameter}
\alias{diameter}
\title{Diameter statistic}
\usage{
diameter(phy, weight = FALSE)
}
\arguments{
\item{phy}{phylo object or ltable}

\item{weight}{if TRUE, uses branch lengths.}
}
\value{
Diameter
}
\description{
The Diameter of a tree is defined as the maximum length of a
shortest path. When taking branch lengths into account, this is equal to
twice the crown age.
When the tree is unrooted, we add 1 to the unweighted diameter, to reflect
traversing the (virtual) root.
}
\references{
Chindelevitch, Leonid, et al. "Network science inspires novel
tree shape statistics." PloS one 16.12 (2021): e0259877.
}
