compareCrimes: Creates evidence variables by calculating 'distance' between...

Description Usage Arguments Value References Examples

Description

Calculates spatial and temporal distance, difference in categorical, and absolute value of numerical crime variables

Usage

1
2
compareCrimes(Pairs, crimedata, varlist, binary = TRUE, longlat = FALSE,
  show.pb = FALSE, ...)

Arguments

Pairs

(n x 2) matrix of crimeIDs

crimedata

data.frame of crime incident data. There must be a column named crimedata that refers to the crimeIDs given in Pairs. Other column names must correspond to what is given in varlist list.

varlist

a list with elements named: crimeID, spatial, temporal, categorical, and numerical. Each element should be a vector of the column names of crimedata corresponding to that feature:

  • crimeID: crime ID for the crimedata that is matched to Pairs

  • spatial: X,Y coordinates (in long,lat or Cartesian) of crimes

  • temporal: DT.FROM, DT.TO of crimes. If times are uncensored, then only DT.FROM needs to be provided.

  • categorical: (optional) categorical crime variables

  • numerical: (optional) numerical crime variables

binary

(logical) match/no match or all combinations for categorical data

longlat

(logical) are spatial coordinates in (long,lat)?

show.pb

(logical) show the progress bar

...

other arguments passed to hidden functions

Value

data.frame of various proximity measures between the two crimes

References

Porter, M. D. (2014). A Statistical Approach to Crime Linkage. arXiv preprint arXiv:1410.2285.. http://arxiv.org/abs/1410.2285

Examples

1
2
3
4
5
6
7
8
9
data(crimes)
 pairs = t(combn(crimes$crimeID[1:4],m=2))   # make some crime pairs

 varlist = list(
   spatial = c("X", "Y"),
   temporal = c("DT.FROM","DT.TO"),
   categorical = c("MO1",  "MO2", "MO3"))    # crime variables list

 compareCrimes(pairs,crimes,varlist,binary=TRUE)

crimelinkage documentation built on May 2, 2019, 1:36 a.m.