% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/asc_entities.R
\name{asc_entities}
\alias{asc_entities}
\title{Identify Functional Entities (Species Clustering)}
\usage{
asc_entities(
  traits,
  dist_method = "gower",
  hclust_method = "ward.D2",
  k = NULL,
  h = NULL
)
}
\arguments{
\item{traits}{A data frame or matrix of functional traits.}

\item{dist_method}{Character. Distance metric. Default is \code{"gower"} to handle mixed data types.}

\item{hclust_method}{Character. Agglomeration method for hierarchical clustering. Default is \code{"ward.D2"}.}

\item{k}{Integer. Desired number of functional entities (clusters). If \code{NULL}, \code{h} must be provided.}

\item{h}{Numeric. Height at which to cut the dendrogram. If both \code{k} and \code{h} are \code{NULL}, defaults to \code{k = 3}.}
}
\value{
An S3 object of class \code{ascfcd_entities}.
}
\description{
Clusters species into discrete functional entities based on shared
morphological, physiological, or ecological traits.
}
\examples{
traits <- data.frame(
  Mass = c(15, 30, 60, 150, 400),
  Beak = c(10, 15, 28,  45,  85),
  Diet = factor(c(0, 1, 1, 1, 0))
)
rownames(traits) <- paste0("Sp", 1:5)

ent <- asc_entities(traits, k = 2)
summary(ent)

}
