dcount_xy: Count of points within distance of polygon
Description
Given a base X/Y dataset, calculates number of feature points that are within particular distance
Usage
dcount_xy(base, feat, d, weight = 1)
Value
A vector of counts (or weighted sums)
Arguments
base
base dataset (eg gridcells), needs to be SpatialPolygonsDataFrame
feat
feature dataset (eg another crime generator), needs to be SpatialPointsDataFrame
d
scaler distance to count (based on polygon boundary for base, not centroid)
weight
if 1 (default), does not use weights, else pass in string that is the variable name for weights in feat
Details
This generates a count (or weighted count) of features within specified distance of the basepolygon border.
Both should be projected in the same units. Uses raster::buffer() on feat dataset (which calls rgeos) and sp::over functions.
References
Groff, E. R. (2014). Quantifying the exposure of street segments to drinking places nearby. Journal of Quantitative Criminology, 30(3), 527-548.
See Also
dist_xy() for calculating distance to nearest
count_xy() for counting points inside polygon
kern_xy() for estimating gaussian density of points for features at base polygon xy coords
bisq_xy() to estimate bi-square kernel weights of points for features at base polygon xy coords
idw_xy() to estimate inverse distance weights of points for features at base polygon xy coords