get_local_density: Get local 2D density

View source: R/stats.R

get_local_densityR Documentation

Get local 2D density

Description

Compute a 2D density estimate and return the estimate evaluated at each pair of points

Usage

get_local_density(x, y, group = NULL, ...)

Arguments

x

a vector of x-values

y

a vector of y-values

group

a group

...

arguments to pass to ks::kde for the density estimation

Details

This is useful for computing color-density scatterplots.

Examples

overlapping = data.frame(x = rt(3e3, df = 3), y = rt(3e3, df = 3))
get_local_density(overlapping$x, overlapping$y)

andrewGhazi/geryon documentation built on April 14, 2025, 3:51 p.m.