extract_fire: Extracting fires from the spatiotemporal clustering results

View source: R/extract_fire.R

extract_fireR Documentation

Extracting fires from the spatiotemporal clustering results

Description

This function takes a spotoroo object to produce a data frame which contains information about the fire.

Usage

extract_fire(result, cluster = "all", noise = FALSE)

Arguments

result

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

cluster

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

noise

Logical. Whether or not to include noise.

Value

A data.frame. The fire information

  • lon : Longitude.

  • lat : Latitude.

  • obsTime : Observed time.

  • timeID : Time indexes.

  • membership : Membership labels.

  • noise : Whether it is a noise point.

  • distToIgnition : Distance to the ignition location.

  • distToIgnitionUnit : Unit of distance to the ignition location.

  • timeFromIgnition : Time from ignition.

  • timeFromIgnitionUnit : Unit of time from ignition.

  • type : Type of the entry, either "hotspot", "noise" or "ignition"

  • obsInCluster : Number of observations in the cluster.

  • clusterTimeLen : Length of time of the cluster.

  • clusterTimeLenUnit : Unit of length of time of the cluster.

Examples



  # 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)


  # Extract all fires
  all_fires <- extract_fire(result)
  head(all_fires, 3)

  # Extract cluster 4
  fire_4 <- extract_fire(result, 4)
  head(fire_4, 3)



TengMCing/spotoroo documentation built on Nov. 21, 2024, 4:17 a.m.