Errata

Learning R

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date submitted
Printed Page 21
3rd paragraph

The code created on pages 20 and 21 displays afinn as one graph and bing and nrc into another graph. Thus, when you run the code you'll get an image with two graphs in it.

But Figure 2-3 shows three graphs. I was able to replicate this image but only by using different code than what is shown in the book.

Ross Ruchti  Apr 24, 2018 
Printed Page 26
Second last paragraph

Paragraph describes size of types. Actual values are the reverse of this paragraph. The paragraph is also contradicted with the correct information in the next paragraph.

Paragraph in error also cites 16-bits as "single precision". 16-bit would only ever be used in a discussion about integers, not floating point. Unless someone is interested in low precision floating point over the range -126.999 ... 126.999.

The next paragraph states the largest/smallest numbers that can be represented have exponents of 308 and -308. These are clearly values for 64-bit floating point.

Floating point numbers in R are 64-bit NOT 32-bit.

Suggest it should read:
Note that as of the time of writing, all floating point numbers are 64-bit numbers ("double precision"), even when installed on a 32-bit operating system, and 32-bit floating point numbers ("single precision don't exist.

My edition: September 2013 First Edition
2013-09-06: First release.

Purchased from Amazon Feb 2016

Greg Bek  Mar 09, 2016 
Printed Page 27
footnote 1

"brobdingnab" should read "brobdingnag"

Peter Duffy  Jan 05, 2017 
PDF Page 34
Excercise 1-3

Command demo(plot math) returnes Error: unexpected symbol in "demo(plot math"

It should be demo(plotmath) instead?

Anonymous  Apr 21, 2021 
Printed, PDF, ePub, Mobi, , Other Digital Version Page 74
middle

When listing all the possible ways of indexing a data frame, I missed one case out. You can pass a vector inside single square brackets, for example:

a_data_frame[2:3]

This is a type of list indexing, but isn't common. In fact, it's best practise to replace this style of index with the matrix style:

a_data_frame[2:3, ]

Richie Cotton  Aug 13, 2014 
PDF Page 79
second code listing

The PDF has:

## January February March April May
## 0.6494 1.4838 0.9665 0.4527 0.7752

where the following might be expected:

Error in g(x) : object 'y' not found

Mark Syddall  Aug 05, 2014 
PDF Page 80
second code listing

The PDF has:

## January February March April May
## -8.436 6.583 -2.727 -11.976 -6.171

where the following might be expected:

Error in h(9) : object 'y' not found

Mark Syddall  Aug 05, 2014 
PDF Page 89
after 2nd code fragment

The output should be:

Error in g(x) : object 'y' not found

Nico Verwer  Aug 18, 2014 
PDF Page 90
after 2nd code fragment

The output of this code should be:

Error in h(9) : object 'y' not found

Nico Verwer  Aug 18, 2014 
PDF Page 114
1st paragraph

x <- sqrt(-1 + 0i)

(reality <- if(Re(x) == 0) "real" else "imaginary")

The result is an imaginary number and the rest should read

(reality <- if(Im(x) == 0) "real" else "imaginary")

Besides, parentheses are superfluous.

Boris  Jan 07, 2017 
PDF Page 355
Question 2-3 answers 2 & 3

Answer no. 2 should be =
Answer no. 3 should be <<-

Hence, no + signs...

Igor  Apr 21, 2021