Data Science Foundations and Machine Learning with R: From Data to Decisions
Welcome

Welcome to the online companion to Data Science Foundations and Machine Learning with R: From Data to Decisions. This website provides access to the book, R code, datasets, and supporting resources for learning data science and machine learning with R.
The book is designed for readers who are new to data science, programming, and machine learning. It is suitable for students, professionals, researchers, and independent learners who want to develop practical data analysis skills while also understanding the statistical and computational ideas behind the methods they use. No prior programming or analytics experience is required, although active engagement with the examples and exercises is essential.
The book is organized around the Data Science Workflow, which connects problem formulation, data preparation, exploratory analysis, modeling, evaluation, and interpretation. A dedicated opening chapter introduces R from the beginning, allowing readers to build the programming foundation needed for the later chapters. Throughout the book, concepts are connected to reproducible R examples, applied case studies, and exercises based on real-world datasets.
Using R, an open-source language widely used in statistics, data science, academia, and industry, readers will gain experience with:
- data cleaning and transformation;
- exploratory data analysis and statistical summaries;
- statistical inference and hypothesis testing;
- regression models for continuous, binary, and count outcomes;
- supervised learning methods, including k-nearest neighbors, Naive Bayes, decision trees, random forests, and neural networks;
- unsupervised learning through clustering;
- model evaluation, comparison, and interpretation.
The book is supported by the liver package, available from CRAN. The package provides datasets and helper functions used throughout the examples, case studies, and exercises.
The latest online version of the book is available at: https://book-data-science-r.netlify.app
The source code is available on GitHub: https://github.com/RezaMoammadi/Book-Data-Science-R
Feedback and Corrections
This online version is maintained as a living resource. Suggestions, corrections, and comments are welcome.
📧 Send an email
🐛 Open an issue or pull request on GitHub
Book by Reza Mohammadi is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International
The book website is hosted on Netlify.
:::