near_repeat_analysis {rcrimeanalysis} | R Documentation |
Near Repeat Analysis of Crime Incidents with Crime Linkage Output
Description
This function performs near repeat analysis for a set of incident locations. The user specifies distance and time thresholds which are utilized to search all other incidents and find other near repeat incidents. From this an adjacency matrix is created for incidents which are related under the thresholds. The adjacency matrix is then used to create an igraph graph which illustrates potentially related or linked incidents (under the near repeat thresholds).
Usage
near_repeat_analysis(
data,
epsg,
dist_thresh = NULL,
time_thresh = NULL,
tz = NULL
)
Arguments
data |
Data frame of crime or RMS data. See provided Chicago Data Portal example for reference |
epsg |
The EPSG Geodetic Parameter code for the area being considered. The EPSG code is used for identifying projections and performing coordinate transformations. If needed, the EPSG for an area can be found at https://spatialreference.org. |
dist_thresh |
The spatial distance (in meters) which defines a near repeat incident. By default this value is set to 1000 meters. |
time_thresh |
The temporal distance (in days) which defines a near repeat incident. By default this value is set to 7 days. |
tz |
Time zone for which the area being examined. By default this value is assigned as the same time zone of the system. For more information about time zones within R, see https://www.rdocumentation.org/packages/base/versions/3.6.1/topics/timezones. |
Value
Returns a list of all near repeat series identified within the input data as igraph graph objects. This list can be used to generate plots of each series and to discern the near repeat linkages between the crime incidents.
Author(s)
Jamie Spaulding, Keith Morris
Examples
data(crimes)
nr_data <- head(crimes, n = 1000) #truncate dataset for near repeat analysis
out <- near_repeat_analysis(data=nr_data,tz="America/Chicago",epsg="32616")