dimred_encircle: Encircle using KDE contours

View source: R/plot_dimred_encircle.R

dimred_encircleR Documentation

Encircle using KDE contours

Description

Calculate kernel density estimates and extract contour lines at a given level to make flexible encircling of points.

Usage

dimred_encircle(
  x,
  y,
  ...,
  contour_level = "3%",
  contour_factor = 1,
  bandwidth = c(10, 10)
)

Arguments

...

Passed on toe ks:kde

contour_level

Character string for which contour level to use (Default: "3%")

contour_factor

contour_levels only available for whole percentages. If an intermediate level or a level below "1%" is needed, the contour level value is divided by this factor.

bandwidth

Bandwidth passeds on the ks::kde

data

matrix or data frame with x and y values as the first two columns

Details

Modified from: https://stackoverflow.com/questions/23437000/how-to-plot-a-contour-line-showing-where-95-of-values-fall-within-in-r-and-in

Value

data.frame of contour points


Terkild/scutility documentation built on Jan. 16, 2025, 5:28 p.m.