I've been reading your book to learn some R in my spare time, and I've noticed that the rwunderground library, used as an example in the Control Structures chapter, does not work (at least as of the time of this post), one needs a paid API key to access the service, see for instance this Github issue or the official announcement, so perhaps you could switch to using a different library, or a different example (the latter is simpler, I imagine).