From 16e948f487f6258d0d9d5d7f49543daaacfd7cfb Mon Sep 17 00:00:00 2001 From: jjchern Date: Mon, 23 May 2016 18:25:38 -0500 Subject: [PATCH 1/5] Fix a type --- wrangle.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wrangle.Rmd b/wrangle.Rmd index 4df5bed..732fb73 100644 --- a/wrangle.Rmd +++ b/wrangle.Rmd @@ -4,7 +4,7 @@ With data, the relationships between values matter as much as the values themselves. Tidy data encodes those relationships. -Throughout this book we work with "tibbles" instead of the traditional data frame. Tibbles _are_ data frames but they encode some patterns that make modern usage of R better. Unfortunately R is an old language, and things that made sense 10 or 20 years a go are no longer as valid. It's difficult to change base R without breaking existing code, so most innovation occurs in packages, providing new functions that you should use instead of the old ones. +Throughout this book we work with "tibbles" instead of the traditional data frame. Tibbles _are_ data frames but they encode some patterns that make modern usage of R better. Unfortunately R is an old language, and things that made sense 10 or 20 years ago are no longer as valid. It's difficult to change base R without breaking existing code, so most innovation occurs in packages, providing new functions that you should use instead of the old ones. ```{r} library(tibble) From 74c27cfd2a7539316bcbb9ab80306716b4181580 Mon Sep 17 00:00:00 2001 From: jjchern Date: Mon, 23 May 2016 18:30:53 -0500 Subject: [PATCH 2/5] "vs" should be "vs." --- wrangle.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wrangle.Rmd b/wrangle.Rmd index 732fb73..2327a5f 100644 --- a/wrangle.Rmd +++ b/wrangle.Rmd @@ -38,7 +38,7 @@ frame_data( ) ``` -## Tibbles vs data frames +## Tibbles vs. data frames There are two main differences in the usage of a data frame vs a tibble: printing, and subsetting. From a43a2e82dc598f158b4857bc26e3abd0874934d4 Mon Sep 17 00:00:00 2001 From: jjchern Date: Mon, 23 May 2016 18:33:30 -0500 Subject: [PATCH 3/5] "vs" should be "vs." --- transform.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transform.Rmd b/transform.Rmd index 2441de5..d77fbbc 100644 --- a/transform.Rmd +++ b/transform.Rmd @@ -681,7 +681,7 @@ ggplot(delays, aes(n, delay)) + geom_point() ``` -Not suprisingly, there is much more variation in the average delay when there are few flights. The shape of this plot is very characteristic: whenever you plot a mean (or many other summaries) vs number of observations, you'll see that the variation decreases as the sample size increases. +Not suprisingly, there is much more variation in the average delay when there are few flights. The shape of this plot is very characteristic: whenever you plot a mean (or many other summaries) vs. number of observations, you'll see that the variation decreases as the sample size increases. When looking at this sort of plot, it's often useful to filter out the groups with the smallest numbers of observations, so you can see more of the pattern and less of the extreme variation in the smallest groups. This is what the following code does, and also shows you a handy pattern for integrating ggplot2 into dplyr flows. It's a bit painful that you have to switch from `%>%` to `+`, but once you get the hang of it, it's quite convenient. From 0eb06e7b7475708977780c02f6f094fcf381bc2d Mon Sep 17 00:00:00 2001 From: jjchern Date: Mon, 23 May 2016 18:35:41 -0500 Subject: [PATCH 4/5] "vs" should be "vs." --- iteration.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iteration.Rmd b/iteration.Rmd index 92609a2..a9eb8c1 100644 --- a/iteration.Rmd +++ b/iteration.Rmd @@ -375,7 +375,7 @@ I mention while loops briefly, because I hardly ever use them. They're most ofte } ``` -## For loops vs functionals +## For loops vs. functionals For loops are not as important in R as they are in other languages because R is a functional programming language. This means that it's possible to wrap up for loops in a function, and call that function instead of using the for loop directly. From ffdf38d2bf06005180ee3526e0e83af76df0c5dc Mon Sep 17 00:00:00 2001 From: jjchern Date: Mon, 23 May 2016 18:37:05 -0500 Subject: [PATCH 5/5] "vs" should be "vs." --- strings.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/strings.Rmd b/strings.Rmd index 33443a4..fd8c60a 100644 --- a/strings.Rmd +++ b/strings.Rmd @@ -815,7 +815,7 @@ There are a few other functions in base R that accept regular expressions: stringr is built on top of the __stringi__ package. stringr is useful when you're learning because it exposes a minimal set of functions, that have been carefully picked to handle the most common string manipulation functions. stringi on the other hand is designed to be comprehensive. It contains almost every function you might ever need. stringi has `r length(ls(getNamespace("stringi")))` functions to stringr's `r length(ls("package:stringr"))`. -So if you find yourself struggling to do something that doesn't seem natural in stringr, it's worth taking a look at stringi. The use of the two packages is very similar because stringr was designed to mimic stringi's interface. The main difference is the prefix: `str_` vs `stri_`. +So if you find yourself struggling to do something that doesn't seem natural in stringr, it's worth taking a look at stringi. The use of the two packages is very similar because stringr was designed to mimic stringi's interface. The main difference is the prefix: `str_` vs. `stri_`. ### Encoding