plot_def: Default method of plotting the clustering results

Description Usage Arguments Value Examples

View source: R/plot_def.R

Description

This function plots the clustering result spatially as a scatter plot.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
plot_def(
  result,
  cluster = "all",
  hotspot = TRUE,
  noise = FALSE,
  ignition = TRUE,
  from = NULL,
  to = NULL,
  bg = NULL
)

Arguments

result

spotoroo object. A result of a call to hotspot_cluster().

cluster

Character/Integer. If "all", plot all clusters. If an integer vector is given, plot corresponding clusters.

hotspot

Logical. If TRUE, plot the hot spots.

noise

Logical. If TRUE, plot the noise points.

ignition

Logical. If TRUE, plot the ignition points.

from

OPTIONAL. Date/Datetime/Numeric. Start time. The data type needs to be the same as the provided observed time.

to

OPTIONAL. Date/Datetime/Numeric. End time. The data type needs to be the same as the provided observed time.

bg

OPTIONAL. ggplot object. If specified, plot onto this object.

Value

A ggplot object. The plot of the clustering results.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
  # Time consuming functions (>5 seconds)


  # Get clustering results
  result <- hotspot_cluster(hotspots,
                          lon = "lon",
                          lat = "lat",
                          obsTime = "obsTime",
                          activeTime = 24,
                          adjDist = 3000,
                          minPts = 4,
                          minTime = 3,
                          ignitionCenter = "mean",
                          timeUnit = "h",
                          timeStep = 1)

  # Plot a subset of clusters
  plot_def(result, cluster = 1:3)

  # Plot all clusters
  plot_def(result, cluster = "all")

spotoroo documentation built on Nov. 10, 2021, 9:08 a.m.