Problems with New S book * indicates fixed in second printing # indicates fixed in fourth printing Page What ix# Wrong AT&T address, phone number 4 Blurred right side of Fig 1.1 19# consult Devices in Appendix 1 (not devices) 24# streak in 2.14 29# answers to problem 2.5 are wrong -- should be [1] 545.865 41.245 172.536 213.110 2183.394 [6] 172.788 96.100 35.898 885.639 685.409 62# Devices in Appendix 1 (not devices) 85 Pie chart washed out, also asymmetric legend (too much space @ bottom) 90# (David Combs) persp example won't work because max(i$z) is NA replace the first two lines of the example by: > p <- i$z > p[is.na(p)] <- min(p[!is.na(p)]) > p <- p/max(p) 92# Last two lines of mixplot are wrong; ylab and zlab should be interchanged. 99 Problem 5.1, either include sum(x)/length(x) or delete from answer (p147) 107 as.complex(-1) could also be written -1+0i 109 first in table: Arg(z) element of -pi,pi, should be element sign, not eps 109 4th line in table, Z for complex should be boldface 109 14th line in table (for tanh), last column should be phi 116* z<-list(... should end with hs.grads=0) 119 lottery.payoff--so (mid page) the "so" should be in roman font 121 should mention synchronize() when discussing database commit 122 line 6, for clarity the second call to sum() should eg be sum(1:9), with the result 45 on the following line (ray) 130 better to use col.means <- numeric(ncol(xm)) 144 line 10, "matrix" should be "matrix or array" in this sentence 148 answer to 5.20, the ed commands turn octal 174 | into a newline and mess up the scan; also, the final \& should be \\& 186 3rd line of section 7.1, garbled sentence (ray) 198 caps example -- add sentence telling what the routine does first 206 Dotted line too light 208# line -5, args[0] should be values[0] 208# 0 in call to call_S should be (void **)0 (allen mcintosh) 208 note, some older C compilers may not recognize void * 217* Assignment operator missing for "diag<-" (ray) 234 table heading "Vector" should probably read "Elements of Vector" and parens surrounding elements should be omitted (not really S syntax) 234* replace 2 lines "this.call <- ...; mode(this.call)..." with "this.call <- call(as.name(what),args)" 235* Scratch through line 2 (ray) 236* Scratch through top of page (ray) 255* line 5, the reference to section 7.3.5 should be to 7.3.4.(ray) 264* list(d="", od=0, g=0, d=0, t=0) doesn't work right because two names are identical. Should use cd="" and later use cdate <- honda$cd. 270* function day.of.week is wrong 308 these high-level plot args are not included in detailed doc 310 Gray too light 313* Word obscured in line describing lwd (ray) 314 Dotted line too light (also duplicates plot on pg 627) 317* line -5: args in wrong order: "mtext(label,side,line)" 323 Can't see US outline 329 Gray too light 330# mtext(...outer=T) should be done AFTER the plot() 331 tsplot(hstart) overlaid by tsplot(ship) is misleading because hstart and ship have different start times 339 Spelling, last word before Table 11.2, should be operators (ray) 356 (Michael Buckley, DSIR) ``note that the fourth actual argument matches the first formal argument by position'' --- is also wrong, I believe. The fourth actual argument, ``a'', matches the first formal argument in the step 2 of (the uncorrected version of) ``pmatch''. If this fourth actual argument is changed from ``a'' to ``b'', a different result is returned. In fact this result is the correct one, but only fortuitously. Also, the result of the pmatch should be 5 2 3 3 3 1 3. 381 equation should be e1==(e1%/%e2)*e2+e1%%e2. 386 argument x should be character string (cf. doc for cat) (terp via allan) 387 get rid of drop() in call to assign 401 Documentation for Bind refers to print.compiled which is not there 402 missing comma after "width" in boxplot doc 402 boxplot: `names' only looks at the names attribute of the first list. 407 Should func be declared "char *"? The expression "pointer to an S function" is possibly wrong and almost certainly unhelpful. Either say correctly what this argument is, or else deliberately use a "void *" and tell the user never to mess with it. 408 The example for call_S is completely messed up: it doesn't set the second elements of arguments, modes or lengths, and treats nx as if it were a (long *),not a (long), use func, not *func in call to call_S. It's not clear that the declaration for func and the use of *func in the call_S are sensible or even work. BEST TO REDO THIS EXAMPLE COMPLETELY! 410 default for levels is sort(unique(x)) 418 clorder example doesn't work (NA not allowed) (ray) fix by using namean <- function(x) mean(x[!is.na(x)]) ave.repub <- apply(votes.repub, 1, namean) 420 comparison operators can have character args. 424 Contour plot not centred (ray) 430 in doc for Defunct: s/old-S with/with old-S/ (allan) 432 Deprecated functions should include pardump (ray) 434 help(Devices), not help("devices") 440 dist: "binary" is the proportion of nonzeros that the vectors DO NOT have in common. 448 page number heading specifies dyn.load, which is on previous page (ray) 460 3rd line up, "which" should be "where" in docs for get (ray) 465 hclust: `plclust' is misspelled in SEE ALSO. 468 conflict between arg list max=1 and Default 10 in description of max. 484 page heading s/be .Last (ray) 485 legend should have args ncol= and background= 500 ls.summary docs do not mention stud.res or cov.unscaled components (ray) 514 in nargs() 3rd last word in VALUE description s/be "that" (ray) 517 examples are identical to those of documentation for double (terp) 518 6th line up, extra occurrence of word "exits," (ray) 520 options(keep) specifies "functions" as default, actual default is "function", but in fact any non-NULL string has the same effect, including presumably "not-functions". The ability to use any string should be documented (ray) 524 longley.collab no longer exists -- omit it from the pairs call 526 doc for par does not mention parameter "lwd" 529 parse shown to have two file= options, second one to be deleted (ray) 536 "author.rowlab" should be "dimanmes(author.count)[[1]]" 538 restore() should have VALUE entry (exit status), see LOG # 519 (ray) 544 pratom() should have VALUE specified as does print() (ray) 547 print.compiled not documented (not in help() either) but is referenced pg 401 (ray) 548 prlist() should have VALUE specified as does print() (ray) 579 8th line up, scan docs refer to "nmax" when argument is n (ray) 590 period missing from first line of Value description for Stable (ray) 594 stem: `twodig' is logical, not numeric. 603 svd docs for VALUE %* s/be %*%, bx s/be by (twice) (ray) 603 quotes should be matched in sweep title (FUN="-") 613 1+q sup 2 should be 1 + q sup 2 / df should be d not d sub 1 in the exponent should be a factor of sqrt(d) in the denominator in front. 614 function tabulate not documented at all, (nor referenced in index) (ray) 630 unix() should have a VALUE entry, for output=F it returns the exit status of the command (ray) 655 Texy-y should be Text-y in doc for ps.preamble 656 just before last line, should have .Random.seed <- oldseed (jbk) 660 page heading s/be switzerland (ray) 678 line -9, `possible' 682 line 12 `lappy' should be `lapply' 689 4 different index entries for "dim attribute" (ray) 690 reference to ed function on page 14 should be a reference to ed UNIX command (allan) 695 index entries for mode[,] function are mixed up (ray)