Skip to content

Commit

Permalink
Merge branch 'master' of github.com:hadley/r4ds
Browse files Browse the repository at this point in the history
  • Loading branch information
garrettgman committed Dec 18, 2015
2 parents ec249c8 + a27f519 commit 1767198
Show file tree
Hide file tree
Showing 18 changed files with 199 additions and 34 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,5 @@ deploy:
secret_access_key:
secure: "KB6D4dRFyqABOUBC6q6CTI7WZQ+4kFOSDWNQFAbXJQR4TzR8J6uddAiSZyG8T1/8z+9Lm1VK417Zi0dGm3r3epbSnLClitBetvE11DoByomK+ey+NJ0MdXuXbFCJhX9l+8QDbDRLd/b2MEr36JXNaNQaLf5wdHImVVfcCm5STAIOM42plYMvz4Uhao+VjIKo+0IqiGHQHsNcU4qQXS4jd4FtO/t1xCwa7SgH0wwV2yJmeh8mM7QpmUEpBcZTHDvqZu6BitxtkYQDCh1iuBwhbPlYug/WOtyHmKYgU/c3+C+xW4OLv10OsE+eK6noEzIXQ80sPIyKMpkn+9P+7MnoRU/oZTXmYJOuXE5mvy+CiJ4TzZZxzB/g8HzklRRI4eFBmJ/zTTMmJMwBdbUhCXepARe4gr7pDFKhSTXvBVxljJBrkiGz6W1JeZ9nKzUbuIlWNJ9aaYM2UDMbRef7xyKlKbBNw1+90aTTW8Jo+0Sz3/R7daBTcnr0Bszg4QCaOMoxJJF/Ty/tTHiComAt/kNRqlSiU2g/Ch0jOz5TRV3c29OjQQ/a9ftf5pqlvgStwjjszgHQfRrd4mxGq2E/1gkPGL7ada+TWPAVjCc8HtPGK/36IjSccFB6qGkwTFf3uOBmAC2XVnJJlwG8v20nL5ZZwpCCbQANeQq/ILQsYUmk7RM="
bucket: r4ds.had.co.nz
endpoint: r4ds.had.co.nz.s3-website-us-east-1.amazonaws.com
local-dir: _site
skip_cleanup: true
8 changes: 4 additions & 4 deletions _plugins/rmarkdown.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ def convert(content)

# http://rubyquicktips.com/post/5862861056/execute-shell-commands
content = `_plugins/knit.r temp.Rmd`

if $?.exitstatus != 0
raise "Knitting failed"
raise "Knitting failed"
end

content
# File.unlink f.path
end
end
end
end
5 changes: 5 additions & 0 deletions data-structures.Rmd
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
layout: default
title: Data structures
---

# Data structures

Might be quite brief.
Expand Down
8 changes: 8 additions & 0 deletions datetimes.Rmd
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
---
layout: default
title: Dates and times
---

# Dates and times


If you have trouble remembering these abbreviations, check out the [strptimer package](https://cran.r-project.org/web/packages/strptimer/vignettes/strptimer.html).
5 changes: 5 additions & 0 deletions eda.Rmd
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
layout: default
title: Exploratory data analysis
---

# Exploratory data analysis

```{r, include = FALSE}
Expand Down
5 changes: 5 additions & 0 deletions functions.Rmd
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
layout: default
title: Expressing yourself in code
---

# Expressing yourself in code

```{r, include = FALSE}
Expand Down
5 changes: 5 additions & 0 deletions import.Rmd
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
layout: default
title: Data import
---

# Data import

```{r, include = FALSE}
Expand Down
11 changes: 8 additions & 3 deletions intro.Rmd
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
title: Introduction
layout: default
---

# Introduction

```{r setup-intro, include = FALSE}
Expand Down Expand Up @@ -71,7 +76,7 @@ Another class of big data problem consists of many small data problems. Each ind

### Python

In this book, you won't learn anything about Python, Juli, or any other programming language useful for data science. This isn't because we think these tools are bad. They're not! And in practice, most data science teams use a mix of languages, often at least R and Python.
In this book, you won't learn anything about Python, Julia, or any other programming language useful for data science. This isn't because we think these tools are bad. They're not! And in practice, most data science teams use a mix of languages, often at least R and Python.

However, we strongly believe that it's best to master one tool at a time. You will get better faster if you dive deep, rather than spreading yourself thinly over many topics. This doesn't mean you should be only know one thing, just that you'll generally learn faster if you stick to one thing at a time.

Expand Down Expand Up @@ -104,7 +109,7 @@ To run the code in this book, you will need to install both R and the RStudio ID

RStudio is an integated development environment, or IDE, for R programming. There are three key regions:

```{r}
```{r, echo = FALSE}
knitr::include_graphics("screenshots/rstudio-layout.png")
```

Expand All @@ -124,7 +129,7 @@ If you want to see a list of all keyboard shortcuts, use the meta keyboard short

We strongly recommend making two changes to the default RStudio options:

```{r}
```{r, echo = FALSE}
knitr::include_graphics("screenshots/rstudio-workspace.png")
```

Expand Down
9 changes: 7 additions & 2 deletions lists.Rmd
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
layout: default
title: Lists
---

# Lists

```{r setup-lists, include=FALSE}
Expand Down Expand Up @@ -44,7 +49,7 @@ x <- list(1, 2, 3)
str(x)
x_named <- list(a = 1, b = 2, c = 3)
str(x)
str(x_named)
```

Unlike atomic vectors, `lists()` can contain a mix of objects:
Expand Down Expand Up @@ -536,7 +541,7 @@ You'll see an example of this in the next section, as `transpose()` is particula

It's called transpose by analogy to matrices. When you subset a transposed matrix, you switch indices: `x[i, j]` is the same as `t(x)[j, i]`. It's the same idea when transposing a list, but the subsetting looks a little different: `x[[i]][[j]]` is equivalent to `transpose(x)[[j]][[i]]`. Similarly, a transpose is its own inverse so `transpose(transpose(x))` is equal to `x`.

Tranpose is also useful when working with JSON apis. Many JSON APIs represent data frames in a row-based format, rather than R's column-based format. `transpose()` makes it easy to switch between the two:
Transpose is also useful when working with JSON apis. Many JSON APIs represent data frames in a row-based format, rather than R's column-based format. `transpose()` makes it easy to switch between the two:

```{r}
df <- dplyr::data_frame(x = 1:3, y = c("a", "b", "c"))
Expand Down
5 changes: 5 additions & 0 deletions model-assess.Rmd
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
layout: default
title: Model assessment
---

# Model assessment

```{r setup-model, include=FALSE}
Expand Down
5 changes: 5 additions & 0 deletions model-vis.Rmd
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
layout: default
title: Model visualisation
---

# Model visualisation

Gap minder
5 changes: 5 additions & 0 deletions model.Rmd
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
layout: default
title: Model
---

# Model

Models are one of the most important tools for data scientists, because models describe relationships. Would you list out every value of a variable, or would you state the mean? Would you list out every pair of values, or would you state the function between variables?
Expand Down
9 changes: 8 additions & 1 deletion rmarkdown.Rmd
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
---
layout: default
title: R Markdown
---

# R Markdown

Recommendations for learning more about communication:

For writing: [Style: Lessons in Clarity and Grace](http://amzn.com/0321898680), <http://www.americanscientist.org/issues/id.877,y.0,no.,content.true,page.1,css.print/issue.aspx>

For presentations: [slide:ology](http://amzn.com/0596522347), <http://www.howtogiveatalk.com>, <https://github.com/jtleek/talkguide> (academic).
For presentations: [slide:ology](http://amzn.com/0596522347), <http://www.howtogiveatalk.com>, <https://github.com/jtleek/talkguide> (academic), http://speaking.io, https://www.coursera.org/learn/public-speaking

For expository visulisations: WSJ guide?

Design: [The Non-Designer's Design Book](http://amzn.com/0133966151)
5 changes: 5 additions & 0 deletions shiny.Rmd
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
---
layout: default
title: Shiny
---

# Shiny
7 changes: 6 additions & 1 deletion strings.Rmd
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# String manipulation
---
layout: default
title: Strings
---

# Strings

```{r setup-strings, include = FALSE}
library(stringr)
Expand Down
5 changes: 5 additions & 0 deletions tidy.Rmd
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
layout: default
title: Tidy data
---

# Tidy data

> "Tidy datasets are all alike but every messy dataset is messy in its
Expand Down
Loading

0 comments on commit 1767198

Please sign in to comment.