Exercises for crime mapping with R

These exercises accompany the free online textbook Learn Crime Mapping with R. Use them to practise combining the skills you have learned in the book to answer a new question.

Choose an exercise

Each exercise states the chapters you should have completed before starting. The exercises are ordered from those requiring the fewest chapters to those requiring the most. Work at your own pace and complete all the prerequisite chapters before attempting an exercise.

How to practise

  1. Read the task and check that you have completed its prerequisite chapters.
  2. Attempt the task yourself in your Positron workspace. You can refer back to the textbook.
  3. Use the checklists on the exercise page to help you make sure you have included everything that is needed for each exercise.
  4. Compare your work with the specimen answer. Different code can produce an equally good answer.
  5. Explain any differences.

Specimen answers have their own pages so that you can choose when to consult them. Each answer includes a complete downloadable file to help you review your work.

Title Attempt after You will create
Mapping homicides in Retiro Chapters 1–2 R script
Mapping terrorist attacks in London Chapters 1–3 R script
Mapping thefts from vehicles in Vancouver Chapters 1–5 R script
Mapping damage to property in Montreal Chapters 1–5 R script
Mapping fatal shootings in New York City Chapters 1–7 R script
Mapping homicides in the São Paulo region Chapters 1–7 R script
Mapping opioid overdose calls in Tempe Chapters 1–7 R script
Mapping stalking rates in Queensland Chapters 1–5, 7, 9 R script
Mapping property crime rates in Poland Chapters 1–5, 9 R script
No matching items