Building a Book

Building a Book
Author

Just Testing

Published

February 9, 2023

Prompt:

The goal of this week’s blog is to document what you are doing when things do not go according to plan.

Similar to previous exercises, we have a specific use case in mind: we want to build a book from a github repository.

What happens in practice usually, is that we run into some problems. So your real task turns into that of a bug-hunter and fixer. Luckily, you have a community (the class discussion board) who might be able to help you.

What we want: build a book

Build the html version of the 2nd edition for Hadley Wickham’s book Advanced R Programming from a github repository.

Steps:

  1. Clone the repository https://github.com/hadley/adv-r.
  2. Open the R project in the repository in RStudio.
  3. Activate the Build tab (by default in the top right panel). Click on the Build Book button.
  4. The book will be available in html format as index.html

Deliverable (1): what is the last word in chapter 15? - You don’t have to answer this question, if things don’t work.

The last word in chapter 15 is “class.” The last word in chapter 15 before the exercises is “packages.”

What to do when things don’t work?

Errors happen, they are frustrating, but if we learn something from them, we can turn them into valuable experiences.

  • check the Questions and Answers forum in Canvas whether there is a solution available for your problem.

  • if the above document does (not yet) include your question, document the error you encounter (be as concise and specific as you can at the same time)

  • if the Question and Answers forum does (not yet) include a solution, describe one approach on how you tried to solve the problem (and how this did not work).

  • submit the description of your problem in Canvas at Discussions > Questions and Answers. Write the paragraph in the mindset that you want to get help from somebody, and you try to describe the problem you are encountering.

  • Extra points (1 pt for the first suggested working solution): post a solution to one of the problems in the Questions and Answers forum (your own does not count!).

Deliverable (2): Write a paragraph on the biggest problem you encountered when you were building the book, (and how you managed to solve it.)

I was lucky not to run into any huge problems building the book. The biggest problem was an error involving the emo package. Unlike the other missing packages, it couldn’t be installed with install.packages("emo"). However, through a quick Google search of the error returned from the install.packages("emo") command, I found a https://stackoverflow.com/questions/25721884/how-should-i-deal-with-package-xxx-is-not-available-for-r-version-x-y-z-wa asking about a similar error. A helpful answer informed me that this error could be because the package is not in CRAN, so I decided to google the package. This led me to a Github repo for the package with instructions on how to install it: devtools::install_github("hadley/emo").

Submit to your repo and you are done!