This function plots the timeline of the fires and the noise points.
Usage
plot_timeline(
result,
from = NULL,
to = NULL,
mainBreak = NULL,
minorBreak = NULL,
dateLabel = NULL
)
Arguments
- result
spotoroo
object. A result of a call tohotspot_cluster()
.- 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.
- mainBreak
OPTIONAL. Character/Numeric. A string/value giving the difference between major breaks. If the observed time is in date/datetime format, this value will be passed to
ggplot2::scale_x_date()
orggplot2::scale_x_datetime()
asdate_breaks
.- minorBreak
OPTIONAL. Character/Numeric. A string/value giving the difference between minor breaks. If the observed time is in date/datetime format, this value will be passed to
ggplot2::scale_x_date()
orggplot2::scale_x_datetime()
asdate_minor_breaks
.- dateLabel
OPTIONAL. Character. A string giving the formatting specification for the labels. If the observed time is in date/datetime format, this value will be passed to
ggplot2::scale_x_date()
orggplot2::scale_x_datetime()
asdate_labels
. Unavailable if the observed time is in numeric format.
Examples
# \donttest{
# 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)
#>
#> ──────────────────────────────── SPOTOROO 0.1.4 ────────────────────────────────
#>
#> ── Calling Core Function : `hotspot_cluster()` ──
#>
#> ── "1" time index = 1 hour
#> ✔ Transform observed time → time indexes
#> ℹ 970 time indexes found
#>
#> ── activeTime = 24 time indexes | adjDist = 3000 meters
#> ✔ Cluster
#> ℹ 16 clusters found (including noise)
#>
#> ── minPts = 4 hot spots | minTime = 3 time indexes
#> ✔ Handle noise
#> ℹ 6 clusters left
#> ℹ noise proportion : 0.935 %
#>
#> ── ignitionCenter = "mean"
#> ✔ Compute ignition points for clusters
#> ℹ average hot spots : 176.7
#> ℹ average duration : 131.9 hours
#>
#> ── Time taken = 0 mins 1 sec for 1070 hot spots
#> ℹ 0.001 secs per hot spot
#>
#> ────────────────────────────────────────────────────────────────────────────────
# Plot timeline
plot_timeline(result,
mainBreak = "1 week",
minorBreak = "1 day",
dateLabel = "%b %d")
# }