kde_int_comp: Comparison of KDE Maps Across Specified Time Intervals

View source: R/kde_int_comp.R

kde_int_compR Documentation

Comparison of KDE Maps Across Specified Time Intervals

Description

This function calculates and compares the kernel density estimate (heat maps) of crime incident locations from two given intervals. The function returns a net difference raster which illustrates net changes between the spatial crime distributions across the specified intervals.

Usage

kde_int_comp(data, start1, end1, start2, end2)

Arguments

data

Data frame of crime or RMS data. See provided Chicago Data Portal example for reference

start1

Beginning date for the first interval of comparison

end1

Final date for the first interval of comparison

start2

Beginning date for the second interval of comparison

end2

Final date for the second interval of comparison

Value

Returns a shiny.tag.list object which contains three leaflet widgets: a widget with the calculated KDE from interval 1, a widget with the calculated KDE from interval 2, and a widget with a raster of the net differences between the KDE (heat maps) of each specified interval.

Author(s)

Jamie Spaulding, Keith Morris

Examples

#Using provided dataset from Chicago Data Portal:
data(crimes)
int_out <- kde_int_comp(crimes, start1="1/1/2017", end1="3/1/2017",
                                start2="1/1/2018", end2="3/1/2018")

rcrimeanalysis documentation built on May 31, 2023, 8:54 p.m.