% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plotting.r
\name{compute_KNN_from_dist}
\alias{compute_KNN_from_dist}
\title{Compute K-Nearest Neighbors (KNN) from Distance Matrix}
\usage{
compute_KNN_from_dist(dist_mat, knn_k)
}
\arguments{
\item{dist_mat}{A square distance matrix or an object of class \code{dist}.}

\item{knn_k}{Integer. The number of neighbors (\code{k}) to return for each
sample.}
}
\value{
A matrix with \code{nrow(dist_mat)} rows and \code{knn_k} columns,
where each row contains the indices of the nearest neighbors.
}
\description{
Identifies the indices of the K-nearest neighbors for each sample based on a
pre-computed distance matrix.
}
