Here we consider one fixed rotation of the data and

seek hot spots using a classification tree

1 2 3 4 5 6 7 8 9 10 |

`formula` |
A formula expression. The left-hand-side (response) should be either a numerical vector when a regression tree will be fitted or a factor, when a classification tree is produced. The right-hand-side should be a series of numeric or factor variables separated by +; there should be no interaction terms. Both . and - are allowed: regression trees can have offset terms. |

`rotX` |
data, possibly already rotated |

`NullClass` |
if y is a factor, this is the category used for the background |

`minsize` |
minimum number of points inside a cluster |

`minArea` |
minimum area of a cluster, units: lat*lon |

`maxArea` |
maximum area of a cluster, units: lat*lon |

`ORfilter` |
filter on minimum and maximum odds ratios (OR) |

`TreeAlgorithm` |
which tree algorithm to choose |

`verbose` |
level of verbosity |

`...` |
further arguments to |

identified clusters (if any)

Markus Loecher

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | ```
#examples to come
data("drugCrimes", envir = environment())
drugCrimes$MATCH = factor(drugCrimes$MATCH)
spot1 = getHotspots(MATCH ~ X+Y,drugCrimes, minArea=20/10^6,maxArea=250/10^6,
ORfilter=list(OR=FALSE,OR1=0.8,OR2=0.1))
suppressWarnings(suppressMessages(library("PBSmapping")))
PBSmapping::plotPolys(spot1[1:5,],density=NULL,xlim=range(drugCrimes$X),ylim=range(drugCrimes$Y),
border="blue",lwd=2)
ranRows=sample(1:nrow(drugCrimes), 5000)
points(Y~X,data=drugCrimes[ranRows,],col=RgoogleMaps::AddAlpha(4-as.numeric(MATCH)),pch=20,cex=0.6)
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.