heatmapFromPoints: Creates a heatmap from a set of points.

View source: R/heatmapFromPoints.R

heatmapFromPointsR Documentation

Creates a heatmap from a set of points.

Description

Generates a heatmap based on the density of points in a given dataset. It utilizes kernel density estimation to visualize the concentration of points, allowing for adjustments in color palette and plotting limits.

Usage

heatmapFromPoints(data, plim = NULL, plot.pal = TRUE, ...)

Arguments

data

A data frame containing the coordinates of the points with columns named 'x' and 'y'.

plim

Optional vector of length two specifying the plotting limits for the density values. If provided, values outside this range will be adjusted.

plot.pal

A logical value indicating whether to plot the color palette alongside the heatmap (default is TRUE).

...

Additional graphical parameters to customize the image.

Value

A matrix of density values corresponding to the heatmap.

Examples

# Generate example data
set.seed(123)
data <- data.frame(x = rnorm(1000), y = rnorm(1000))

# Create a heatmap from the points
heatmap_result <- heatmapFromPoints(data)


BioTrajectory documentation built on June 8, 2025, 11:54 a.m.