% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/distance.R
\name{distance_matrix}
\alias{distance_matrix}
\title{Compute pairwise taxonomic distances for a set of taxa}
\usage{
distance_matrix(taxa, verbose = FALSE, progress = TRUE)
}
\arguments{
\item{taxa}{A character vector of taxon names.}

\item{verbose}{Logical. If \code{TRUE}, prints progress for each pair.
Default \code{FALSE}.}

\item{progress}{Logical. If \code{TRUE}, shows a progress bar. Default \code{TRUE}.}
}
\value{
A symmetric numeric matrix of class \code{"dist"} containing pairwise
distances. Row and column names are set to the input taxon names.
Taxa that could not be found are included with \code{NA} distances.
An empty input returns an empty \code{"dist"} object.
}
\description{
Given a vector of taxon names, computes all pairwise taxonomic hierarchy distances
and returns a symmetric distance matrix. Lineages are cached after first
retrieval to minimise redundant network requests.
}
\examples{
\donttest{
theropods <- c("Tyrannosaurus", "Velociraptor", "Spinosaurus",
               "Allosaurus", "Carnotaurus")
mat <- distance_matrix(theropods)
print(mat)
}
}
\seealso{
\code{\link[=taxo_distance]{taxo_distance()}}, \code{\link[=closest_relative]{closest_relative()}}
}
