Errata

Hands-On Programming with R

Errata for Hands-On Programming with R

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released. If the error was corrected in a later version or reprint the date of the correction will be displayed in the column titled "Date Corrected".

The following errata were submitted by our customers and approved as valid errors by the author or editor.

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

Version Location Description Submitted By Date submitted Date corrected
Printed
Page x
2nd para

Duplicate 'any' in the sentence:

"I would not recommend that any any ..."

William Byrd  Sep 02, 2014  Jan 23, 2015
Other Digital Version
loc 1708
First paragraph

The page reads (location 1708 of 7221, Kindle edition, iPad)
Every CSV file shares this basic format:
"face","suit","value"
"king","spades",13
"queen","spades,12
"jack","spades,11
"ten","spades,10
"nine","spades,9
... and so on.

With the missing quotes in place, It should read
Every CSV file shares this basic format:
"face","suit","value"
"king","spades",13
"queen","spades",12
"jack","spades",11
"ten","spades",10
"nine","spades",9
... and so on.

Note from the Author or Editor:
The missing quotes should be added. There appears to be a quote missing at the end of each suit name.

Cilio Ziviani  Dec 12, 2015 
Other Digital Version
loc2811
First paragraph, location 2811, Kindle edition

The book reads
This arrangement creates a quandry for R whenever R runs a function.

It should read
This arrangement creates a quandary for R whenever R runs a function.

Note from the Author or Editor:
I think the reviewer has spotted an html tag that slipped through to the text. The html tag appears in my email notification ( a <p> tag at the end of the sentence), but the html tag does not appear above in the O'Reilly Errata portal. The tag should be removed.

Cilio Ziviani  Dec 16, 2015 
Printed
Page 1
Pg 94 (3rd para) and 95 (1st para)

Parenvs function is found in pryr package, not devtools

Dennis Yap San Hong  Oct 04, 2014  Jan 23, 2015
Printed
Page 2
9th line from top

tiny typos;
... seem frivilous, think of ...
->
... seem frivolous, think of ...


Yukitoshi Fujimura  Aug 21, 2014  Jan 23, 2015
Printed, PDF
Page 5
second paragraph

"The colon operator (+) returns�" should be "The colon operator (:) returns�"

Brian Drye  Jul 30, 2014  Jan 23, 2015
Printed
Page 11
Figure 1-4

The operation shown in t he figure is multiplication while the discussion preceding it is addition. The results shown is incorrect for multiplication (but correct for addition).

Note from the Author or Editor:
In Figure 1-4, each of the multiplication symbols (*) should be changed to an addition symbol (+). There are 10 total that should be corrected.

Dan Watts  Aug 07, 2014  Jan 23, 2015
Printed, PDF
Page 11
4th line bottom

Just need [,] notation for both column and row;

die%*%die
## 91

should be

die%*%die
## [,1]
##[1,] 91

Note from the Author or Editor:
Yes, the code at the bottom of page 11 should read:

die %*% die
## [,1]
## [1,] 91

Yukitoshi Fujimura  Aug 21, 2014  Jan 23, 2015
Printed
Page 19
Second paragraph from bottom

In the second sentence of the second paragraph from the bottom, the word "function" (written in "code" font) is split between two lines (func... tion). Is it possible to fit this word on one line?

Garrett Grolemund
Garrett Grolemund
 
Dec 11, 2014  Jan 23, 2015
Printed
Page 27
3rd paragraph

"Numbers covered by a tall bar are no more common than ...." should be "Numbers covered by a tall bar are more common than ...."

Dan Watts  Aug 07, 2014  Jan 23, 2015
Printed
Page 39
After the second paragraph of text

The book reads:

sum(num)
## 6

It SHOULD say:

sum(int)
## 6

Garrett Grolemund
Garrett Grolemund
 
Dec 11, 2014  Jan 23, 2015
Printed
Page 40
3rd paragraph

"Integers are defined more precisely in your computer's memory than doubles (unless the integer is 'very' large or small)."
I understand what is written for large integers, but small (or very small) integers are close to zero. Perhaps it should have been "'very' large positive or negative".

Note from the Author or Editor:
Change text to read:

"Integers are defined more precisely in your computer's memory than doubles (unless the integer is very large)."

Dan Watts  Aug 07, 2014  Jan 23, 2015
Printed
Page 44
Code at bottom of the page with Spanish numbers from 1-6

"quatro" should be spelled "cuatro." It is listed twice in the code.

Garrett Grolemund
Garrett Grolemund
 
Dec 11, 2014  Jan 23, 2015
Printed
Page 82
Last paragraph ("Next, you can use...")

On the second line of that paragraph, "individually" is misspelled. (It has an extra u.)

Garrett Grolemund
Garrett Grolemund
 
Dec 11, 2014  Jan 23, 2015
Printed
Page 96
2nd and 3rd paragraphs

2nd paragraph: ..."the parenvs function in the devtools package.''
3rd paragraph (code example: "library(devtools)"

The 'parenvs' function is no longer in the 'devtools package; it has been move to the "pryr" package.

Bill Kehoe  Dec 25, 2014  Jan 23, 2015
Printed
Page 105
First paragraph, second line

"Pristine" is misspelled. (It has an extra i.)

Garrett Grolemund
Garrett Grolemund
 
Dec 11, 2014  Jan 23, 2015
PDF
Page 118
"If a subtask seems complicated, try to divide it again into even subtasks that are even more simple"

"If a subtask seems complicated, try to divide it again into even subtasks that are even more simple"

should be

"If a subtask seems complicated, try to divide it again into smaller subtasks that are even more simple"

Note from the Author or Editor:
Change "If a subtask seems complicated, try to divide it again into even subtasks that are even more simple" to "If a subtask seems complicated, try to divide it again into smaller subtasks that are even more simple"

Eric Watt  Dec 13, 2014  Jan 23, 2015
Printed
Page 125
Numbered list at the top of the page

Numbers 2 and 3 are out of sequence in the list.

1) Test whether the symbols are three of a kind.

2) Look up the prize for three of a kind based on the common symbol.

3) Test whether the symbols are all bars.

Garrett Grolemund
Garrett Grolemund
 
Dec 11, 2014  Jan 23, 2015
PDF
Page 127
Middle of page

Original wrong code: length(unique(symbols) == 1)

Correct code: length(unique(symbols)) == 1

Dennis Yap San Hong  Oct 07, 2014  Jan 23, 2015
Printed
Page 134
1st paragraph

"And when cherries equals three ..." should be "And when cherries equal two ..."

Dan Watts  Aug 10, 2014  Jan 23, 2015
Printed
Page 137
Code just above "Summary"

The last example of the play function is missing a double B. It should read:

play()
## "BB" "BB" "BB"
## 25

Garrett Grolemund
Garrett Grolemund
 
Dec 11, 2014  Jan 23, 2015
Printed
Page 163
Second paragraph from bottom

The second to last paragraph ("On the first run, the for loop...") should end with a period and not a colon.

Garrett Grolemund
Garrett Grolemund
 
Dec 11, 2014  Jan 23, 2015
PDF
Page 171
Last paragraph and code below

function used is called abs_set in the text, but abs_sets in the code

Note from the Author or Editor:
The code on page 171 and 172 should be altered. Specifically the line on page 171: "abs_sets <- function(vec){" should be changed to "abs_set <- function(vec){", and the line on page 172: "system.time(abs_sets(long))" should be changed to "system.time(abs_set(long))"

Eric Watt  Dec 13, 2014  Jan 23, 2015
PDF
Page 178
Code examples

Code does not run as written. Example given is
system.time(
output <- rep(NA, 1000000)
for (i in 1:1000000) {
output[i] <- i + 1
}
)

Had to be modified to

system.time({
output <- rep(NA, 1000000)
for (i in 1:1000000) {
output[i] <- i + 1
}
})

Note from the Author or Editor:
Add a set of braces immediately inside the parentheses that follow system.time (like this):

system.time({
output <- rep(NA, 1000000)
for (i in 1:1000000) {
output[i] <- i + 1
}
})

Eric Watt  Dec 13, 2014  Jan 23, 2015
Printed, PDF
Page 180
last paragraph, first sentence

typo: "(matix-ized?)" should be "(matrix-ized?)"

Brian Drye  Aug 07, 2014  Jan 23, 2015
PDF
Page 180
1st paragraph

'In fact, the simulation takes 342,308 seconds to run, which is about 5.7 minutes'

Should be 342.308 seconds.

Note from the Author or Editor:
342,308 needs to be changed to 342.308

Eric Watt  Dec 13, 2014  Jan 23, 2015
Printed
Page 192
Third paragraph

In the sentence, "If this is your first time installing a package...", delete the extraneous "of."

It should say: "... choose an online mirror to install from."

Garrett Grolemund
Garrett Grolemund
 
Dec 11, 2014  Jan 23, 2015