Skip to content

Commit

Permalink
new link-checker; fix links
Browse files Browse the repository at this point in the history
  • Loading branch information
jrnold committed May 18, 2019
1 parent 1d559d4 commit a03237d
Show file tree
Hide file tree
Showing 17 changed files with 429 additions and 34 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# Exercise Solutions to R for Data Science

This repository contains the code and text behind the [Solutions for R for Data Science](https://jrnold.github.io/r4ds-exercise-solutions/), which, as its name suggests, has solutions to the the exercises in [R for Data Science](http://r4ds.had.co.nz/) by Garrett Grolemund and Hadley Wickham.
This repository contains the code and text behind the [Solutions for R for Data Science](https://jrnold.github.io/r4ds-exercise-solutions/), which, as its name suggests, has solutions to the the exercises in [R for Data Science](https://r4ds.had.co.nz/) by Garrett Grolemund and Hadley Wickham.

The R packages used in this book can be installed via
```r
Expand Down
4 changes: 2 additions & 2 deletions _common.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ SOURCE_URL <- stringr::str_c("https:/", "github.com", "jrnold",
"r4ds-exercise-solutions",
sep = "/"
)
PUB_URL <- stringr::str_c("http:/", "jrnold.github.io",
PUB_URL <- stringr::str_c("https:/", "jrnold.github.io",
"r4ds-exercise-solutions",
sep = "/"
)

R4DS_URL <- "http://r4ds.had.co.nz"
R4DS_URL <- "https://r4ds.had.co.nz"

r4ds_url <- function(...) {
stringr::str_c(R4DS_URL, ..., sep = "/")
Expand Down
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
github_repo: "jrnold/r4ds-exercise-solutions"
deploy_url: "https://jrnold.github.io/r4ds-exercise-solutions"
deploy_url: "https://jrnold.github.io/r4ds-exercise-solutions/"
r4ds:
github_repo: "hadley/r4ds"
url: "https://r4ds.had.co.nz"
Expand Down
4 changes: 2 additions & 2 deletions functions.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ coef_variation(c(1:5, NA), na.rm = TRUE)

<div class="question">

Follow <http://nicercode.github.io/intro/writing-functions.html> to write your own functions to compute the variance and skew of a numeric vector.
Follow <https://nicercode.github.io/intro/writing-functions.html> to write your own functions to compute the variance and skew of a numeric vector.

</div>

Expand Down Expand Up @@ -697,7 +697,7 @@ Why doesn’t this currently work? How could you fix it?

<div class="answer">

This is the definition of the rule function from the [chapter](http://r4ds.had.co.nz/functions.html).
This is the definition of the rule function from the [chapter](https://r4ds.had.co.nz/functions.html).
```{r}
rule <- function(..., pad = "-") {
title <- paste0(...)
Expand Down
2 changes: 1 addition & 1 deletion import.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ The list in the documentation for `stringi::stri_enc_detect()` is a good list of
For more information on character encodings see the following sources.

- The Wikipedia page [Character encoding](https://en.wikipedia.org/wiki/Character_encoding), has a good list of encodings.
- Unicode [CLDR](http://cldr.unicode.org/) project
- Unicode [CLDR](https://cldr.unicode.org/) project
- [What is the most common encoding of each language](https://stackoverflow.com/questions/8509339/what-is-the-most-common-encoding-of-each-language) (Stack Overflow)
- "What Every Programmer Absolutely, Positively Needs To Know About Encodings And Character Sets To Work With Text", <http://kunststube.net/encoding/>.

Expand Down
8 changes: 4 additions & 4 deletions index.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ knitr::opts_chunk$set(cache = FALSE)

<img src="./img/r4ds-exercise-solutions-cover.png" width="250" height="375" alt="Cover image" align="right" style="margin: 0 1em 0 1em"/>

This book contains the **exercise solutions** for the book [*R for Data Science*](http://amzn.to/2aHLAQ1), by Hadley Wickham and Garret Grolemund [@WickhamGrolemund2017].
This book contains the **exercise solutions** for the book [*R for Data Science*](https://amzn.to/2aHLAQ1), by Hadley Wickham and Garret Grolemund [@WickhamGrolemund2017].

*R for Data Science* itself is available online at [r4ds.had.co.nz](http://r4ds.had.co.nz/), and physical copy is published by O'Reilly Media and available from [amazon](http://amzn.to/2aHLAQ1).
*R for Data Science* itself is available online at [r4ds.had.co.nz](https://r4ds.had.co.nz/), and physical copy is published by O'Reilly Media and available from [amazon](https://amzn.to/2aHLAQ1).

## Acknowledgments {-}

Expand Down Expand Up @@ -117,10 +117,10 @@ A special thanks to:
- [\@dongzhuoer](https://github.com/dongzhuoer) and [\@cfgauss](https://hypothes.is/users/cfgauss) for careful readings 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)
[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 <a rel="license" href="http://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License</a>.
This work is licensed under a <a rel="license" href="https://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License</a>.
4 changes: 2 additions & 2 deletions intro.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The text for each exercise is followed by the solution.
Like *R for Data Science*, packages used in each chapter are loaded in a code chunk at the start of the chapter in a section titled "Prerequisites".
If exercises depend on code in a section of *R for Data Science* it is either provided before the exercises or within the exercise solution.

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)).
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](https://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 {-}
Expand Down Expand Up @@ -49,7 +49,7 @@ github_full_url <- stringr::str_c(SOURCE_URL, "tree", r_sha, sep = "/")
```

HTML and PDF versions of this book are available at <`r PUB_URL`>.
The book is powered by [bookdown](https://bookdown.org) which makes it easy to turn R markdown files into HTML, PDF, and EPUB.
The book is powered by [bookdown](https://bookdown.org/home) which makes it easy to turn R markdown files into HTML, PDF, and EPUB.

The source of this book is available on GitHub at <`r SOURCE_URL`>.
This book was built from commit [`r r_sha_short`](`r github_full_url`).
Expand Down
4 changes: 2 additions & 2 deletions iteration.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ Combine your function writing and for loop skills:

The answers to each part follow.

1. The lyrics for [Alice the Camel](http://www.kididdles.com/lyrics/a012.html) are:
1. The lyrics for [Alice the Camel](https://www.kididdles.com/lyrics/a012.html) are:

> Alice the camel has five humps. \
> Alice the camel has five humps. \
Expand Down Expand Up @@ -634,7 +634,7 @@ Write code that uses one of the map functions to:
```
1. To calculate the type of every column in `nycflights13::flights` apply
the function `typeof()`, discussed in the section on [Vector basics](http://r4ds.had.co.nz/vectors.html#vector-basics),
the function `typeof()`, discussed in the section on [Vector basics](https://r4ds.had.co.nz/vectors.html#vector-basics),
and use `map_chr()`, since the results are character.
```{r}
map_chr(nycflights13::flights, typeof)
Expand Down
2 changes: 1 addition & 1 deletion model-basics.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ best$par
```

In practice, I suggest not using `optim()` to fit this model, and instead using an existing implementation.
The `rlm()` and `lqs()` functions in the [MASS](https://cran.r-project.org/package=MASS) fit robust and resistant linear models.
The `rlm()` and `lqs()` functions in the [MASS](https://CRAN.R-project.org/package=MASS) fit robust and resistant linear models.

</div>

Expand Down
2 changes: 1 addition & 1 deletion model-building.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ Write a small function to set the levels of the factor so that the week starts o

<div class="answer">

See the chapter [Factors](http://r4ds.had.co.nz/factors.html) for the function `fct_relevel()`.
See the chapter [Factors](https://r4ds.had.co.nz/factors.html) for the function `fct_relevel()`.
Use `fct_relevel()` to put all levels in-front of the first level ("Sunday").

```{r}
Expand Down
Loading

0 comments on commit a03237d

Please sign in to comment.