Best Coding Practices in R
2024-08-28
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.