st_dbscan_corepoint: Check if points are core points

View source: R/stdbscan.R

st_dbscan_corepointR Documentation

Check if points are core points

Description

Check if data points are core points. A core point is a point with more than min_pts points in its neighborhood.

Usage

st_dbscan_corepoint(data, eps_spatial, eps_temporal, min_pts, ...)

Arguments

data

matrix. A matrix containing, in that order, x, y and t. x (longitude) and y (latitude) are the spatial coordinates and t is the cumulative time since a common origin (e.g. c(0, 6, 10)).

eps_spatial

Numeric. The spatial radius threshold. Points closer than this in space may belong to the same cluster.

eps_temporal

Numeric. The temporal threshold. Points closer than this in time may belong to the same cluster.

min_pts

Integer. Minimum number of points required to form a core point.

...

Additional arguments are passed on to dbscan::frNN().

Value

A boolean vector indicating if data points are core points.

Examples

data(geolife_traj)

geolife_traj$date_time <- as.POSIXct(
  paste(geolife_traj$date, geolife_traj$time),
  format = "%Y-%m-%d %H:%M:%S",
  tz = "GMT"
)
geolife_traj$t <- as.numeric(
  geolife_traj$date_time - min(geolife_traj$date_time)
)
data <- cbind(geolife_traj$x, geolife_traj$y, geolife_traj$t)

res <- st_dbscan_corepoint(
  data = data,
  eps_spatial = 3,
  eps_temporal = 30,
  min_pts = 3
)
head(res)


stdbscan documentation built on March 14, 2026, 5:06 p.m.