Errata
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 6 last paragraph |
pressing CTRL-D in Linux or CMD-D on a Mac |
Yue Zhou | Mar 19, 2012 |
Page 11 the 14th from the bottom |
the author describes a portion of the code as follows : "Finally, we multiplied |
Mouad Seridi | Aug 09, 2015 | |
Printed | Page 23 5 lines from bottom |
"NumericaConstants" should be "NumericConstants" |
Alan Reynolds | Nov 14, 2012 |
Page 30 Taiwan |
page 30 is explaining the vector recycling. |
Guo-Guang Chiou | Apr 19, 2012 | |
Printed | Page 34 Top section |
On page 27, it is stated that "for careful coding you should worry that length(x) might be zero". Now, on page 34, this problem is 'fixed' by writing "for (i in seq(x))". However, for careful coding one should also worry that length(x) might be one! For example, if vector x just contains the number 5, then seq(x) is 1,2,3,4,5 and the code will attempt to iterate over elements of the vector that are not there. |
Alan Reynolds | Nov 14, 2012 |
Printed | Page 34 United States |
As already noted, the use of "seq" with a vector of length one causes problems. Please note that "seq_along" is intended to solve this. See http://stackoverflow.com/questions/13732062/seq-vs-seq-along-when-will-using-seq-cause-unintended-results |
Michael Albert | Aug 24, 2014 |
Page 34 1st paragraph of Section 2.4.5 |
The text says |
razorbill | Apr 01, 2016 | |
Page 34 1st paragraph of Section 2.4.5 |
I just wanted to share my opinion that the error reported by razorbill is not actually an error. |
Anonymous | Nov 05, 2019 | |
Printed | Page 36 Third section of code |
The code where preallocation of the memory space takes place made sense - at least until I got to the note on page 74, which indicates that x[2] <- 12 is actually a reassignment. (See also page 314). So it would appear that reassignment (and hence reallocation) still occurs on line 8 of the code, and is not avoided after all! |
Alan Reynolds | Jan 10, 2013 |
Printed | Page 39 Second code chunk |
# the vector red ... |
R. Mark Sharp | Jan 04, 2012 |
Printed | Page 39 middle of page, in predc function example |
In the comment "# the vector red will contain our predicted values" |
Anonymous | Nov 17, 2015 |
Printed | Page 41 4th example on page |
the assignment operator "<-" is missing between "f" and "function(x,c) return((x+c^2)" |
Anonymous | Nov 17, 2015 |
Other Digital Version | 42 United States |
"Let's first read in the data file: |
Sean Mackesey | Nov 27, 2012 |
Printed | Page 44 Last sentence of 3rd paragraph |
Here are two more ways another way to find ... |
R. Mark Sharp | Jan 04, 2012 |
Printed | Page 49 First line of comment in code at page bottom |
findud() does not convert v to 1s and 0s - it converts to 1s and -1s. |
Alan Reynolds | Nov 16, 2012 |
Printed | Page 53 Last line of code and second to last paragraph |
The second to last paragraph suggests that the second plot command superimposes the graph for females on the same graph as the males. This is not the case, and it is not merely because one set of data covers the other. Compare with the results obtained if the last line is replaced by "points(abaf$Length, abaf$Diameter,pch="x")". |
Alan Reynolds | Nov 16, 2012 |
Printed | Page 53 |
The line: |
Anonymous | Jul 02, 2015 |
Printed | Page 54 Second paragraph |
Of course, the compacted code will also plot an x for each infant abalone too. |
Alan Reynolds | Nov 16, 2012 |
Printed | Page 55 Fourth paragraph, middle of page |
Just because all(x == y) is true does not necessarily mean that the vectors are identical, due to recycling. Consider |
Alan Reynolds | Nov 16, 2012 |
Page 56 above par 6.2 |
"the element of the second row, first column, i.e. the Exam 2 score |
Anonymous | Jul 04, 2017 | |
PDF, ePub | Page 65 R code at the bottom |
At the bottom of page 65, the R codes may not work correctly. The function blurpart() tries to introduce random noises to a portion of the image. However, on the line |
Gu Mi | Oct 18, 2012 |
Printed | Page 65 code block at bottom of page |
As someone else submitted, the code does not work. How did the author generate the image yet still not provide working code? I'm baffled. This code seems more straightforward than what alittleboy submitted. |
pfaffman | Jan 07, 2013 |
Printed | Page 65 2nd code block |
Two errors in this code block. First off in the description of the randomnoise matrix, the variable "ncols" has been used which wasn't defined previously. It should read "lcols". Second even after this correction has been made. R throws an error about the array sizes not matching up: |
John St. John | Nov 09, 2013 |
Printed | Page 65 2nd code block |
The definition of blurpart should be |
Anonymous | Jul 02, 2015 |
Printed | Page 67-67 last line of page 67 - start of page 68 |
The book says "Here's an example with the same x as above". The x used above is x = matrix(c(1,2,3,2,3,4),nrow=3). The results here should then be matrix(c(1,2,3,4),nrow=2). |
Anonymous | Dec 26, 2011 |
Printed | Page 67,68 end/start |
The results here should then be matrix(c(1,3,2,4),nrow=2). |
Anonymous | Jan 23, 2012 |
Printed | Page 67 Bottom |
While the x is "the same as above", what is z? |
Alan Reynolds | Dec 06, 2012 |
Printed | Page 67 Last paragraph |
The code at the bottom of page 67 does not work. If I type |
Evan St. Claire | Sep 07, 2015 |
Printed | Page 69 1 paragraph of the new section |
The paragraph deals with the row and col functions. The text states (correctly) that their arguments are matrices. Then it suggests that, if a is a matrix, row(a[2,8]) will return the row number of that element of a, which is 2. |
Enrico Franchi | Nov 09, 2012 |
Printed | Page 69 4th paragraph |
'Correlation' should perhaps read 'covariance'. (Very minor!) |
Alan Reynolds | Dec 06, 2012 |
Printed | Page 72 Start of code chunk |
Missing a " -> " |
Anonymous | Jan 25, 2012 |
Printed | Page 72 First line of code |
It looks like the assignment operator was left out of the function definition: |
Robert S | Jan 14, 2013 |
Printed | Page 74 In code, middle of page: results of cbind(one,z) |
The matrix resulting from cbind(one, z) should have a column header of "one" in the output, but it doesn't. |
Robert S | Jan 14, 2013 |
Printed | Page 75 Paragraph immediately before 2nd code chunk |
Be careful with rbind and cbin() ... |
R. Mark Sharp | Jan 04, 2012 |
Printed | Page 75 First paragraph after first code example |
"Be careful with rbind and cbin(), though." |
Robert S | Jan 14, 2013 |
Printed | Page 76 First chunk of code |
# wmins will be 2x(n-1), instead of 2xn. |
Lin Zhang | May 22, 2017 |
Printed | Page 77 4th paragraph |
(i+1):(1x-1) should read (i+1):(lx-1) |
Anonymous | Jan 26, 2012 |
Printed | Page 77 3rd paragraph |
"mininum" should read "minimum" (twice) |
Matthew Gillman | Dec 29, 2015 |
Printed | Page 82/83 Throughout |
3rd row, 2nd col entries in both firsttest & secondtest "wrong" (well, changed as if by some perverse magic on next page), making much on page 83 nonsense. |
Anonymous | Jan 25, 2012 |
Printed | Page 93 Lines 10-11 |
The sentence states how convenient it is that list indexing can be done through quoted strings, when perhaps it should say bracketed strings - the code itself doesn't use quoted strings. (Very minor) |
Alan Reynolds | Jan 15, 2013 |
Printed | Page 98 2nd code chunk, 3rd line |
> snyt <- freqwl(nyt) |
R. Mark Sharp | Jan 04, 2012 |
Printed | Page 98 New York Times example |
There is a statement missing after the line snyt <- freqwl(nyt): |
Wolfgang Kittenberger | Dec 16, 2012 |
Page 100 2nh paragraph from the bottom of the page |
The paragraph treats the recursive argument to c() as if it determines the type of output of c() and thus leads to the conclusion "It’s odd that setting recursive to TRUE gives a nonrecursive list.)". |
Umbromancer | Jun 22, 2020 | |
Printed | Page 103 1st paragraph |
"would generally considered to" |
Matthew Gillman | Dec 29, 2015 |
Printed | Page 109 1st code block |
grep("Programmer", all2006) returns the column numbers in which "Programmer" occurs, not the rows as intended to filter the row of the data frame. |
Jacques Philip | Dec 28, 2011 |
Page 111 code at the top |
Code line |
Muhammad Bilal Ahmad | Jul 09, 2016 | |
Printed, PDF | Page 112 Section heading |
Section 5.4.1 does not provide an example of using sapply() on data frames. This might be relevant, because sapply applied to a data frame returns a matrix, not a data frame and this might lead to unwanted coercion. |
Anonymous | Jan 28, 2018 |
Printed | Page 114 R session output |
The output from "loall" lists (Intercept) and clmn for the first 6 variables. However, for the last two "col" is used instead of "clmn". i.e. it's inconsistent. |
Matthew Gillman | Dec 29, 2015 |
Page 114 end of page |
It is mentioned that |
Muhammad Bilal Ahmad | Jul 09, 2016 | |
Printed | Page 115 Last paragraph |
"This a job made for R!" |
Matthew Gillman | Dec 29, 2015 |
Printed, PDF | Page 116 Last sentence on page |
The author states that "We know from the result of the preceding example that there are SIX such characters." However, the preceding example shows that there are FIFTEEN such characters. |
Anonymous | Jan 28, 2018 |
Page 118 Line 37 of code |
Line 37 of the code reads: |
Anonymous | Apr 25, 2015 | |
Printed, PDF | Page 118 Line 19 of the code |
The intention of line 19 of the code for the function merge2fy is to merge the data frames outdf and tmpdf through the merge function. The merge function creates a new data frame by looking for ALL possible matches between ALL columns of outdf and tmpdf, and therefore, a long list is produced. |
Anonymous | Jan 28, 2018 |
Printed, PDF | Page 118 Code in line 38 |
Anonymous' remark on 25 April, 2015 is correct. However, if applied, the code in line 38 needs to be updated to: |
Anonymous | Jan 28, 2018 |
Page 122 Line 10 |
attr(,"levels") should be read as attr(xf,"levels") |
Muhammad Bilal Ahmad | Jul 09, 2016 | |
Printed | Page 124 2nd paragraph (last before section 6.2.2) |
"applied to mean() function" |
Matthew Gillman | Dec 29, 2015 |
Printed | Page 130 3rd paragraph of 6.3.1 |
printed: cttab had class "cttab",... |
Matthew Perry | Apr 21, 2014 |
Printed | Page 130 6.3.1 |
class "cttab" should be class "table" and column should be row |
Anonymous | Jul 27, 2015 |
Page 130 last chunk of code |
>ctt/5 should be |
Muhammad Bilal Ahmad | Jul 09, 2016 | |
Page 130 4 |
There appears "that cttab had class “cttab”" and I think should be "that cttab had class “table”". Even though, if I am right, this is a really minor point! |
Reynaldo Senra | Sep 08, 2016 | |
Page 131 First chunk of code |
apply(ctt,1,sum) should be |
Muhammad Bilal Ahmad | Jul 09, 2016 | |
Printed | Page 132 1st paragraph |
printed: respondents who know they will vote for X... |
Matthew Perry | Apr 21, 2014 |
Printed | Page 134 3rd paragraph, bullet "dim" |
printed: this is the value ndims |
Matthew Perry | Apr 21, 2014 |
Page 137 second last paragraph |
This says that z[1], 0.88114802, fell into bin 9, which was (0,0,0.1]; z[2], |
Muhammad Bilal Ahmad | Jul 11, 2016 | |
Printed, PDF | Page 147 Second oddcount() example |
In the second example of the oddcount() code, the line with 'pagebreak' should be removed. |
Anonymous | Feb 03, 2018 |
Printed | Page 151 3rd code block |
reads: |
Dirk Sarpe | Aug 05, 2012 |
Printed | Page 154-155 Code samples |
Multiple missing "<-"s. |
Anonymous | Feb 04, 2012 |
Printed | Page 160 4th block of R code |
> oddsevens |
William Murrah | Mar 10, 2013 |
Printed | Page 185 Line 25 |
Some LaTeX obvisoulsy got mixed with code, i.e., \begin{Code} and \end{Code} apearing in actual R code |
Simon Knaus | Jun 13, 2012 |
Page 195 2nd paragraph |
I think that in the paragraph "What happened here? We called order() on the second column of y, yielding a vector r, telling us where numbers should go if we want to sort them. The 3 in this vector tells us that x[3,2] is the smallest number in x[,2]; the 1 tells us that x[1,2] is the second smallest; and the 2 tells us that x[2,2] |
Reynaldo Senra | Sep 12, 2016 | |
Page 197 First line of matrix solving code. |
Though the matrix code and its output are self-consistent, they don't match the matrix presented in the example. |
Rasmi | Jul 27, 2015 | |
Page 204 footnote |
A sequence of independent 0- and 1- valued random variables with the same probability of 1 for each is called Bernoulli. |
Muhammad Bilal Ahmad | Jul 11, 2016 | |
Printed | Page 212 3rd paragraph |
It's claimed that "a class instance is created by forming a list...", but in R any object (data.frame, vector, matrix, whatever) can take a 'class' attribute and participate in method dispatch. |
Ken Williams |
Dec 28, 2011 |
Printed | Page 264 Section 12.1.3 |
X11(), macintosh() and windows() functions are introduced stating that you can use them to print two graphs side by side. |
Umbromancer | Jul 09, 2020 |