From eb8a610afc0356f310f9cbf258537b6e24e5bf73 Mon Sep 17 00:00:00 2001 From: jrnold Date: Wed, 16 Jan 2019 21:15:07 -0600 Subject: [PATCH] cleanup - fix markdown - fix links - fix html --- datetimes.Rmd | 2 -- index.Rmd | 8 +++----- intro.Rmd | 4 +--- iteration.Rmd | 4 +--- many-models.Rmd | 2 -- rmarkdown-workflow.Rmd | 2 -- rmarkdown.Rmd | 8 ++++---- visualize.Rmd | 2 +- workflow-projects.Rmd | 2 -- 9 files changed, 10 insertions(+), 24 deletions(-) diff --git a/datetimes.Rmd b/datetimes.Rmd index 62e8e6ec..45ffbd05 100644 --- a/datetimes.Rmd +++ b/datetimes.Rmd @@ -440,5 +440,3 @@ as.Date("2016-02-29") + years(1) ## Time Zones {#time-zones .r4ds-section} `r no_exercises()` - -
diff --git a/index.Rmd b/index.Rmd index 2f188f82..e8548af6 100644 --- a/index.Rmd +++ b/index.Rmd @@ -113,17 +113,15 @@ hypothesis_contribs <- function() { These solutions have benefited from many contributors. A special thanks to: -- Garrett Grolemund and Hadley Wickham for writing the truly fantastic *R for Data Science* , without which these solutions would not exist---literally. - -- [\@dongzhuoer](https://github.com/dongzhuoer) for a careful reading of the book and noticing numerous issues and proposing fixes. +- Garrett Grolemund and Hadley Wickham for writing the truly fantastic *R for Data Science* , without which these solutions would not exist---literally. +- [\@dongzhuoer](https://github.com/dongzhuoer) for a careful reading of the book and noticing numerous issues and proposing fixes. Thank you to all of those who contributed issues or pull-requests on [GitHub](https://github.com/jrnold/r4ds-exercise-solutions/graphs/contributors) (in alphabetical order): `r github_contribs()` Thank you to all of you who contributed annotations on [hypothes.is](https://hypothes.is/search?q=url%3Ajrnold.github.io%2Fr4ds-exercise-solutions%2F*) (in alphabetical order): `r hypothesis_contribs()`. - -## +## License {-} This work is licensed under a Creative Commons Attribution 4.0 International License diff --git a/intro.Rmd b/intro.Rmd index dec0be2a..9d2b1e38 100644 --- a/intro.Rmd +++ b/intro.Rmd @@ -18,7 +18,7 @@ If exercises depend on code in a section of *R for Data Science* it is either pr If a package is used infrequently in solutions it may not be loaded, and functions using it will be called using the package name followed by two colons, as in `dplyr::mutate()` (see the *R for Data Science* [Introduction](http://r4ds.had.co.nz/introduction.html#running-r-code)). The double colon may also be used to be explicit about the package from which a function comes. -## Prerequisites +## Prerequisites {-} This book is a complement to, not a substitute of, [R for Data Science](). It only provides the exercise solutions for it. @@ -58,5 +58,3 @@ This book was built with these R packages. ```{r colonophon} devtools::session_info("r4ds.exercise.solutions") ``` - -
diff --git a/iteration.Rmd b/iteration.Rmd index e50cde21..3ea697d5 100644 --- a/iteration.Rmd +++ b/iteration.Rmd @@ -669,7 +669,7 @@ Write code that uses one of the map functions to: ``` Since a single call of `rnorm()` returns a numeric vector with a length greater than one we cannot use `map_dbl`, which requires the function to return a numeric - vector that is only length one (see [Exercise 21.5.4](exercise-21.5.4)). + vector that is only length one (see [Exercise 21.5.4](#exercise-21.5.4)). The map functions pass any additional arguments to the function being called.
@@ -934,5 +934,3 @@ The `sapply()` function tries to be helpful by simplifying the results, but this It is okay to use the `sapply()` function interactively, but avoid programming with it.
- -
diff --git a/many-models.Rmd b/many-models.Rmd index 49d7a26b..bf777b60 100644 --- a/many-models.Rmd +++ b/many-models.Rmd @@ -270,5 +270,3 @@ Lists are not atomic since they can contain other lists and other vectors. ## Making tidy data with broom {#making-tidy-data-with-broom .r4ds-section} `r no_exercises()` - -
diff --git a/rmarkdown-workflow.Rmd b/rmarkdown-workflow.Rmd index 41814c61..d4afb8c9 100644 --- a/rmarkdown-workflow.Rmd +++ b/rmarkdown-workflow.Rmd @@ -1,5 +1,3 @@ # R Markdown workflow {#r-markdown-workflow .r4ds-section} `r no_exercises()` - -
diff --git a/rmarkdown.Rmd b/rmarkdown.Rmd index 345b8297..e82e8e5e 100644 --- a/rmarkdown.Rmd +++ b/rmarkdown.Rmd @@ -245,7 +245,7 @@ Check that you can run it, then add text after the frequency polygon that descri
-The following R markdown document answers this question as well as exercises [Exercise 27.4.1](exercise-27.4.1), [Exercise 27.4.2](exercise-27.4.2), and [Exercise 27.4.3](exercise-27.4.3). +The following R markdown document answers this question as well as exercises [Exercise 27.4.1](#exercise-27.4.1), [Exercise 27.4.2](#exercise-27.4.2), and [Exercise 27.4.3](#exercise-27.4.3). ```{r diamond-sizes,echo=FALSE,comment='',purl=FALSE} cat(readr::read_file(here::here("rmarkdown", "diamond-sizes.Rmd"))) @@ -264,7 +264,7 @@ Assume you’re writing a report for someone who doesn’t know R, and instead o
-See the answer to [Exercise 27.3.3](exercise-27.3.3). +See the answer to [Exercise 27.3.3](#exercise-27.3.3).
@@ -277,7 +277,7 @@ Add a section that describes the largest 20 diamonds, including a table that dis
-See the answer to [Exercise 27.3.3](exercise-27.3.3). +See the answer to [Exercise 27.3.3](#exercise-27.3.3). I use `arrange()` and `slice()` to select the largest twenty diamonds, and `knitr::kable()` to produce a formatted table. @@ -292,7 +292,7 @@ Also include the percentage of diamonds that are larger than 2.5 carats.
-See the answer to [Exercise 27.3.3](exercise-27.3.3). +See the answer to [Exercise 27.3.3](#exercise-27.3.3). I moved the computation of the number larger and percent of diamonds larger than 2.5 carats into a code chunk. I find that it is best to keep inline R expressions simple, usually consisting of an object and a formatting function. diff --git a/visualize.Rmd b/visualize.Rmd index 37848a22..c0f8c3f1 100644 --- a/visualize.Rmd +++ b/visualize.Rmd @@ -347,7 +347,7 @@ Aesthetics can also be mapped to expressions like `displ < 5`. The `ggplot()` function behaves as if a temporary variable was added to the data with with values equal to the result of the expression. In this case, the result of `displ < 5` is a logical variable which takes values of `TRUE` or `FALSE`. -This also explains why, in [Exercise 3.3.1](exercise-3.3.1), the expression `colour = "blue"` created a categorical variable with only one category: "blue". +This also explains why, in [Exercise 3.3.1](#exercise-3.3.1), the expression `colour = "blue"` created a categorical variable with only one category: "blue".
diff --git a/workflow-projects.Rmd b/workflow-projects.Rmd index a8bde381..38517bd5 100644 --- a/workflow-projects.Rmd +++ b/workflow-projects.Rmd @@ -1,5 +1,3 @@ # Workflow: projects {#workflow-projects .r4ds-section} `r no_exercises()` - -