plot_def | R Documentation |
This function plots the clustering result spatially as a scatter plot.
plot_def(
result,
cluster = "all",
hotspot = TRUE,
noise = FALSE,
ignition = TRUE,
from = NULL,
to = NULL,
bg = NULL
)
result |
|
cluster |
Character/Integer. If "all", plot all clusters. If an integer vector is given, plot corresponding clusters. |
hotspot |
Logical. If |
noise |
Logical. If |
ignition |
Logical. If |
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. |
A ggplot
object. The plot of the clustering results.
# 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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.