Ensure every chapter has a heading

This commit is contained in:
hadley 2016-02-11 16:31:34 -06:00
parent 27cc6617bb
commit d69eeff57e
8 changed files with 17 additions and 2 deletions

View File

@ -3,4 +3,6 @@ layout: default
title: Communicate your work
---
# Communicate your work
Reproducible, literate code is the data science equivalent of the Scientific Report (i.e, Intro, Methods and materials, Results, Discussion).

View File

@ -3,6 +3,8 @@ layout: default
title: Databases
---
# Databases
### Two-table verbs
Each two-table verb has a straightforward SQL equivalent:

View File

@ -3,6 +3,8 @@ layout: default
title: Model
---
# Model
A model is a function that summarizes how the values of one variable vary in response to the values of other variables. Models play a large role in hypothesis testing and prediction, but for the moment you should think of models just like you think of statistics. A statistic summarizes a *distribution* in a way that is easy to understand; and a model summarizes *covariation* in a way that is easy to understand. In other words, a model is just another way to describe data.
This chapter will explain how to build useful models with R.
@ -298,6 +300,7 @@ ns() # natural splines
```
```{r}
library(splines)
tidy(lm(income ~ ns(education, knots = c(10, 17)), data = heights))
tidy(lm(income ~ ns(education, df = 4), data = heights))
```
@ -314,7 +317,7 @@ ggplot(data = heights, mapping = aes(x= education, y = income)) +
```{r}
gam(income ~ s(education), data = heights)
ggplot(data = heights, mapping = aes(x= education, y = income)) +
ggplot(data = heights, mapping = aes(x = education, y = income)) +
geom_point() +
geom_smooth(method = gam, formula = y ~ s(x))
```

View File

@ -3,4 +3,6 @@ layout: default
title: Save time by programming
---
# Programming
Computer-human communication matters.

View File

@ -7,7 +7,7 @@ title: Robust code
library(magrittr)
```
## Robust code
# Robust code
(This is an advanced topic. You shouldn't worry too much about it when you first start writing functions. Instead you should focus on getting a function that works right for the easiest 80% of the problem. Then in time, you'll learn how to get to 99% with minimal extra effort. The defaults in this book should steer you in the right direction: we avoid teaching you functions with major suprises.)

View File

@ -3,4 +3,6 @@ layout: default
title: Do science with data
---
# Do science with data
The scientific method guides data science. Data science solves known problems with the scientific method.

View File

@ -3,4 +3,6 @@ layout: default
title: Understand your data
---
# Understand your data
Data poses a cognitive problem; Data comprehension is a skill.

View File

@ -3,4 +3,6 @@ layout: default
title: Work with your data
---
# Work with your data
With data, the relationships between values matter as much as the values themselves. Tidy data encodes those relationships.