plot_knn_labels: Plot k-Nearest Neighbors Graph with multiple lables

View source: R/Visualizations_Network.R

plot_knn_labelsR Documentation

Plot k-Nearest Neighbors Graph with multiple lables

Description

This function takes a dataframe that contains x and y coordinates and a label that defines the classes and makes a plot of the k-nearest neighbors graph using Euclidean distance and the cover tree algorithm.

Usage

plot_knn_labels(
  df,
  k = 1,
  alpha = 0.7,
  algo = c("kd_tree", "cover_tree", "CR", "brute")
)

Arguments

df

A dataframe with x and y coordinates and a label column defining the classes.

k

An integer that defines the number of nearest neighbors to consider. Default is 1.

Value

A plot of the k-nearest neighbors graph using ggplot2.


eisascience/scCustFx documentation built on June 2, 2025, 3:59 a.m.