% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/unsupervised-dbscan.R
\name{tidy_knn_dist}
\alias{tidy_knn_dist}
\title{Compute k-NN Distances}
\usage{
tidy_knn_dist(data, k = 4, cols = NULL)
}
\arguments{
\item{data}{A data frame or matrix}

\item{k}{Number of nearest neighbors (default: 4)}

\item{cols}{Columns to include (tidy select).
If NULL, uses all numeric columns.}
}
\value{
A tibble with columns \code{.obs_id} (observation identifier),
\code{knn_dist} (distance to k-th nearest neighbor), and \code{rank}
(rank of the k-NN distance).
}
\description{
Calculate distances to k-th nearest neighbor for each point
}
\examples{
\donttest{
knn <- tidy_knn_dist(iris[, 1:4], k = 5)
}

}
