Skip to contents

Runs DBSCAN on rotated-km coordinates and colours points by cluster label (native DBSCAN; cluster ids 1-based in discovery order, 0 for noise, as dbscan::dbscan), with noise rendered grey. Without ggplot2 a base-graphics plot is drawn.

Usage

morie_tps_render_dbscan(
  points_df,
  eps_km = 0.5,
  min_samples = 8L,
  outfile = NULL,
  ...
)

Arguments

points_df

data.frame with columns lat / lon (or LAT_WGS84 / LONG_WGS84).

eps_km

DBSCAN epsilon in kilometres.

min_samples

Minimum samples per cluster.

outfile

Optional output path.

...

Extra plotting args (size, alpha, palette).

Value

ggplot object or invisible NULL.

Examples

set.seed(1)
df <- data.frame(LAT_WGS84 = runif(60, 43.60, 43.85),
                 LONG_WGS84 = runif(60, -79.60, -79.15))
out <- morie_tps_render_dbscan(df, eps_km = 1, min_samples = 4L,
                               outfile = tempfile(fileext = ".png"))