View source: R/get_area_crime.R
get_area_crime | R Documentation |
Get reported crimes since 2014 for a specific area.
get_area_crime(
area,
description = NULL,
date_range = NULL,
where = NULL,
dist = NULL,
diag_ratio = NULL,
asp = NULL,
unit = "m",
trim = FALSE,
crs = pkgconfig::get_config("mapbaltimore.crs", 2804)
)
area |
sf, sfc, or bbox object. If multiple areas are provided, they are
unioned into a single sf object using |
description |
Crime type or description. Supported options include "AGG. ASSAULT", "ARSON", "AUTO THEFT", "BURGLARY", "COMMON ASSAULT", "HOMICIDE", "LARCENY", "LARCENY FROM AUTO", "RAPE", "ROBBERY - CARJACKING", "ROBBERY - COMMERCIAL", "ROBBERY - RESIDENCE", "ROBBERY - STREET", or "SHOOTING". Not case sensitive. |
date_range |
Date range as character vector in format of c("YYYY-MM-DD", "YYYY-MM-DD"). Minimum and maximum values are used if length is greater than 1. |
where |
where query string passed to esri2sf, Default: |
dist |
buffer distance in units. Optional. |
diag_ratio |
ratio of diagonal distance of area's bounding box used as
buffer distance. e.g. if the diagonal distance is 3000 meters and the
"diag_ratio = 0.1" a 300 meter will be used. Ignored when |
asp |
Aspect ratio of width to height as a numeric value (e.g. 0.33) or
character (e.g. "1:3"). If numeric, |
unit |
Units for buffer. Supported options include "meter", "foot", "kilometer", and "mile", "nautical mile" Common abbreviations (e.g. "km" instead of "kilometer") are also supported. Distance in units is converted to units matching GDAL units for x; defaults to "meter" |
trim |
If |
crs |
Cordinate reference system to return, Default: 4326 for
|
## Not run:
# Get shootings for the Lauraville area
area <- get_area("neighborhood", "Barclay")
crimes <- get_area_crime(
area = area,
date_range = c("2022-01-01", "2022-12-31"),
description = "SHOOTING"
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.