Geographic Profiling in R

Mark Stevenson, Roberty Verity and Steve Le Comber

Geographic profiling in R

R is a powerful statistical and analytic tool that has been embraced by the ecological community. Used primarily for statistical analysis, R is increasingly being applied to data visualisation problems as well. Here we present the package Rgeoprofile for the analysis of spatial point pattern data in ecology. This package uses a Bayesian Dirichlet process mixture model to compute and visualise the sources dispersing organisms. This work was developed by Mark Stevenson, Robert Verity, Richard Nichols and Steve Le Comber.

What is geographic profiling?

For details of the background of the method and a list of key references please see the following: Geographic Profiling. Relevant papers can also be found on Research Gate.

R package Rgeoprofile

The R package Rgeoprofile allows users to create geoprofiles using point pattern data. The methods used are based on the Dirichlet Proccess Mixture Model described in  Verity et al. (Methods in Ecology and Evolution, in press). The package loads in long/lat data, sets model parameters, sets the graphical parameters, and uses Rgooglemaps to map the data points, before creating a Bayesian mixture model and fitting parameters with a MCMC. The package renders the posterior surface and produces diagnostic plots, and finally outputs a geoprofile overlayed on a Google map along with the hit scores of any suspect sites.

Here, you can download four files:

1 Rgeoprofile 1.2

2 Rgeoprofile 1.2 user guide

3 dummy crime site data

4 dummy suspect site data

Rgeoprofile 1.2 is the package itself. The Rgeoprofile 1.2 user guide contains a complete walkthrough of the package. You can either use your own data, or use the dummy crime data data and dummy source data provided.

This package runs the DPM mixture model. The package is composed of 8 core functions and 4 accessory functions. The core functions load in the data, set parameters of the model, generates the prior, runs the MCMC, produces maps and saves the results. They should be run in order:

  1. Download and install the package
  2. Import your data
  3. Run LoadData()
  4. Run ModelParameters()
  5. Run GraphicParameters()
  6. Run CreateMaps()
  7. Run RunMCMC()
  8. Run ThinandAnalyse()
  9. Run PlotGP()
  10. OPTIONAL: Run Reporthitscores()

See individual descriptions in the R help files for the use of these functions.


Verity, R., Stevenson, M.D., Rossmo, D.K., Nichols, R.A. & Le Comber, S.C. Spatial targeting of infectious disease control: identifying multiple, unknown sources. Methods in Ecology and Evolution (in press).

Comments are closed.