Skip to content

Open Forensic Science in R

Published: 2019
Primary Author: Samantha Tyner
Secondary Authors: Heike Hofmann, Soyung Park, Eric Hare, Xiao Hui Tai, Karen Kafadar, Karen Pan, Amanda Luby
Research Area: Footwear

This book is for anyone looking to do forensic science analysis in a data-driven and open way. Whether you are a student, teacher, or scientist, this book is for you. We take the latest research, primarily from the Center for Statistics and Applications in Forensic Evidence (CSAFE) and the National Institute of Standards and Technology (NIST) and show you how to solve forensic science problems in R. The book makes some assumptions about you:

  1. You have some experience with R (R Core Team 2019). We don’t assume you are an expert by any means, but we do assume you are comfortable enough with R to install & library packages, load data, identify different data structures, and to follow along with the code we present in each chapter. If you need help getting started with R, there are lots of free resources online, and CSAFE has some resources available here. You can install R for Windows, Mac, and Linux here for free. We also recommend you install RStudio, the wonderful free IDE (Integrated Development Environment) for R. If you want a deeper dive into R, take a walk through R for Data Science. If you really want to explore the depths, Advanced R is an excellent resource.
  2. You are interested in forensic science. Hopefully that’s why you’re here! You may only be interested in DNA or firearms, so we’ve split the book up into chapters by forensic science subfield. You also don’t have to be an expert in the field. We will explain the basics of the field in the introduction of each chapter. You can also download this book by clicking here or by cloning it on GitHub and follow along, running the code on your own computer.
  3. You care about open source software. This doesn’t really affect your ability to read this book, but it’s a nice quality to have. The purpose of this book is to make forensic science more accessible. Right now, most databases, algorithms, and programs that get used every day in forensic science are proprietary, meaning that only the owners know how these systems work, how they were made, and what the source code looks like. This closed approach has lead to miscarriages of justice. With this free online book that relies solely on open-source software for analysis, we hope to demonstrate the impact open source software can have on forensic science, both in research and in practice. And in this spirit of openness, we ask that you contribute if you find an error or want to add a chapter on a topic we did not cover. You can open an issue here or fork the book’s Github repository and submit your changes via a pull request. If you’d like to contribute, we ask that you follow our contributor code of conduct and these recommended practices from Jenny Bryan and Jim Hester of RStudio.

Related Resources

Quantifying the similarity of 2D images using edge pixels: An application to the forensic comparison of footwear impressions

Quantifying the similarity of 2D images using edge pixels: An application to the forensic comparison of footwear impressions

We propose a novel method to quantify the similarity between an impression (Q) from an unknown source and a test impression (K) from a known source. Using the property of…
Quantifying the similarity of 2D images using edge pixels: An application to the forensic comparison of footwear impressions

Quantifying the similarity of 2D images using edge pixels: An application to the forensic comparison of footwear impressions

We propose a novel method to quantify the similarity between an impression (Q) from an unknown source and a test impression (K) from a known source. Using the property of…
A database of two-dimensional images of footwear outsole impressions

A database of two-dimensional images of footwear outsole impressions

Footwear outsole images were obtained from 150 pairs of used shoes. The motivation for constructing the database was to enable a statistical analysis of two-dimensional (2D) images of shoe outsoles,…
CSAFE 2020 All Hands Meeting

CSAFE 2020 All Hands Meeting

The 2020 All Hands Meeting was held May 12 and 13, 2020 and served as the closing to the last 5 years of CSAFE research and focused on kicking off…
Do you have 44.03 seconds?

44.3 Seconds. That is the average amount of time it takes for a visitor to provide site feedback.
Test it yourself by taking the survey.


    A scientist/researcherA member of the forensic science communityA journalist/publicationA studentOther. Please indicate.


    Learn more about CSAFE overall.Discover research CSAFE is undertaking.Explore collaboration opportunities.Find tools and education opportunities.Other. Please indicate.


    YesNo