![](/rp/kFAqShRrnkQMbH6NYLBYoJ3lq9s.png)
Welcome | R for Data Science
R4DS teaches you how to do data science with R: You’ll learn how to get your data into R, get it into the most useful structure, transform it, visualise it and model it. In this book, you will find a practicum of skills for data science.
1 Introduction | R for Data Science - Hadley
The goal of “R for Data Science” is to help you learn the most important tools in R that will allow you to do data science. After reading this book, you’ll have the tools to tackle a wide variety of data science challenges, using the best parts of R.
3 Data visualisation | R for Data Science - Hadley
You can test your answer with the mpg data frame found in ggplot2 (aka ggplot2::mpg). A data frame is a rectangular collection of variables (in the columns) and observations (in the rows). mpg contains observations collected by the US Environmental Protection Agency on 38 models of car.
23 Model basics | R for Data Science - Hadley
The majority of modelling functions in R use a standard conversion from formulas to functions. You’ve seen one simple conversion already: y ~ x is translated to y = a_1 + a_2 * x. If you want to see what R actually does, you can use the model_matrix() function.
22 Introduction | R for Data Science - Hadley
You’ll use your new tools of data wrangling and programming, to fit many models and understand how they work. The focus of this book is on exploration, not confirmation or formal inference. But you’ll learn a few basic tools that help you understand the variation within your models.
27 R Markdown | R for Data Science - Hadley
R Markdown provides an unified authoring framework for data science, combining your code, its results, and your prose commentary. R Markdown documents are fully reproducible and support dozens of output formats, like PDFs, Word files, slideshows, and more.
6 Workflow: scripts | R for Data Science - Hadley
The script editor is also a great place to build up complex ggplot2 plots or long sequences of dplyr manipulations. The key to using the script editor effectively is to memorise one of the most important keyboard shortcuts: Cmd/Ctrl + Enter. This executes the current R expression in the console. For example, take the code below.
20 Vectors | R for Data Science - Hadley
Data frames and tibbles are built on top of lists. This chapter will introduce you to these important vectors from simplest to most complicated. You’ll start with atomic vectors, then build up to lists, and finish off with augmented vectors.
21 Iteration | R for Data Science - Hadley
How can you create a single vector that for each column in a data frame indicates whether or not it’s a factor? What happens when you use the map functions on vectors that aren’t lists? What does map(1:5, runif) do?
13 Relational data | R for Data Science - Hadley
To work with relational data you need verbs that work with pairs of tables. There are three families of verbs designed to work with relational data: Mutating joins, which add new variables to one data frame from matching observations in another.