Practical exercises

Here you can find the exercises for the practical sessions during the course. All content will remain here on the Distance website for future consultation.


Practicals are provided in RMarkdown (.Rmd) format. RMarkdown can be opened in RStudio and the file “knitted” into HTML or PDF.

Note that the practicals are designed to be run sequentially, files generated from previous analyses are loaded and used in subsequent analyses.

Number Practical Description Practical Solution
1 R tutorial (see this page)    
2 Processing sperm whale data Rmd PDF  
3 Fitting detection functions Rmd PDF Rmd PDF
4 Fitting DSMs Rmd PDF Rmd PDF
5 Multiple term DSMs, model checking and selection Rmd PDF Rmd PDF
6 DSM Prediction Rmd PDF Rmd PDF
7 DSM Variance Rmd PDF Rmd PDF
8 Mark-recapture distance sampling Rmd R PDF Distance PDF PDF
9 Simulation of distance sampling data Rmd PDF  

Data sets

Data for the practicals come in a variety of forms for analysis both in R and in Distance 7.

Data for density surface modelling (Practicals 2-7)

To run the sperm whale analysis you’ll need to download the following files, unzip them and store the unzipped folders in the same directory as the Rmd files for practicals 5-10 above:

The Distance 7 project containing these data can be downloaded from this location

We’d like to thank Jason Roberts of Duke University for preparing these files in ArcGIS with the MGET Toolbox.

Data for double platform analysis (Practical 8)

For R users you just need the csv files:

For Distance for Windows users, project files can be downloaded here:

Data for simulation (Practical 9)

zip archive of R practical materials.

Distance 7 projects (DSsimExercise and DSsimExerciseSolutions).


If you run into a problem running any of these examples, please report an issue on this GitHub repository. Or contact the workshop instructors.