How to Use This Book
This book is designed to be flexible. You can read it cover-to-cover, jump directly to specific chapters, or use it as a reference alongside your own projects.
0.4 Chapter Anatomy
The breakdown of the book is as follows:
- Part I: Foundations
- Getting Started with R
- Working with Data Using the tidyverse
- Data Visualization with ggplot2
- Part II: Making Comparisons
- Comparing Two Groups: Data Wrangling, Visualization, and t-Tests
- Comparing Multiple Means
- Analyzing Categorical Data
- Part III: Relationships and Modeling
- Correlation
- Linear Regression
- Logistic Regression
- Part IV: Reproducible Communication
- Reproducible Reporting with R Markdown
Most chapters follow a consistent structure:
- Conceptual explanation of why a tool or method is useful
- Step-by-step code examples
- Visualizations and outputs
- Interpretation and best practices
- A checklist to reinforce reproducible habits
This repetition is intentional. Consistency helps build intuition.
0.5 Code, Data, and Reproducibility
All code in this book is meant to be run, modified, and occasionally broken. Learning happens when you experiment. As my father always says:
That’s why they put erasers on pencils
The datasets used throughout the book are provided in a companion R package so that readers can load them directly without downloading files manually. This ensures that examples work the same way for everyone.
When figures, tables, or analyses appear in this book, they are generated directly from code—never copied and pasted from external software.
0.6 Acknowledgments
This book would not exist without the curiosity, questions, and persistence of students at Brooklyn College. Their willingness to wrestle with messy data and imperfect code shaped both the content and the tone of this text.
Additional thanks go to the Open Educational Resources team at Brooklyn College and to the broader R community, whose commitment to open tools and shared knowledge makes projects like this possible.