Preface

“Everyone who reads your code is a potential serial killer who has the power to make a mistake and ruin your day. Code as if your next maintainer is a maniac who knows where you live.” — John Wood (2004)

Purpose of this Book

This book provides a comprehensive guide to best coding practices in R, focusing on essential aspects like script organisation, naming conventions, commenting, and version control. It aims to enhance the readability, maintainability, and collaborative potential of R code by offering practical advice on creating well-structured and clean scripts.

In addition, the book delves into version control with Git, covering everything from basic commands to advanced workflows, and includes best practices for collaboration using platforms like GitHub. By following these guidelines, readers will improve their coding efficiency, ensure code quality, and facilitate effective teamwork on R projects.

About the Author

Daniel Hammocks is a PhD Candidate in Applied Data Science, specialising in the use of natural language processing to identify emerging methods of criminal perpetration from unstructured free-text crime reports. With over 10 years of programming and Data Science experience, Daniel has been actively researching in the field of Security and Crime Science for more than 6 years. His expertise extends to teaching data science at both an undergraduate and master’s level, where he is deeply committed to upskilling the next generation of crime analysts by empowering them to harness the full potential of data-driven techniques. Currently, Daniel serves as a Senior Data Scientist at the Mayor’s Office for Policing and Crime (MOPAC), where he applies his extensive skills to enhance public safety and security through data-driven insights. - Written by ChatGPT (2024)… I am not taking credit for this one.