!!General comments, suggestions, corrections, etc. about the book
Entries are sorted from most to least recent.
A test message.
c345t
Douglas Bates — 11 December 2008, 17:50
Overall I like this chapter very much. There are a couple of peculiarities that I did notice. On page 11 the call
seq(1:10)
is used. That is a peculiar construction, especially to show to a beginner. The : operator produces a sequence so it is a synonym for a typical usage of the function seq. That is
1:10
is equivalent to
seq(1, 10)
or
seq(1, 10, by = 1)
Writing seq(1 : 10) is applying the seq function twice in a rather obscure way. Much better to just use 1:10
Douglas Bates — 11 December 2008, 18:00
In the discussion about source and sink in section 1.1.6 it may be worthwhile noting that the R versions for Windows and Mac OS X contain a text editor with the convenient feature that you can send individual lines or groups of lines to the console window for evaluation. Use File | New script to open a new text file and add the lines shown on page 12. Then move the cursor to the top line and type <ctrl>-R. That sends the current line to the interpreter and moves to the next line. This often comes as a revelation to students when I am teaching about R.
Douglas Bates — 11 December 2008, 21:28
I think that the no.dimnames function shown on pages 32-33 may be more confusing than illuminating for a beginner. It is not easy to grasp what is going on when the index l is incremented inside the indexing expression. If I were going to write the function using a loop like this I would write
dd <- dim(a) for (i in seq_along(dd)) dimnames(a)i? <- rep('', dd[i])
In most cases, if I want to produce a list I use lapply for which the result is always a list but whose first argument doesn't have to be a list. Its a bit obscure but you could generate a list from the dim(a) vector by
dimnames(a) <- lapply(dim(a), rep.int, x = '')
A slightly less obscure version is
dimnames(a) <- lapply(dim(a), function(n) rep('', n))
Douglas: all you points are well taken; I will get to these soon. In the meantime, if you want, I can create a group of instructors, give you a password for it and then create topics that can be updated like: quizzes, exams, lecture notes and misc. Then all the group members can upload files on these topics and share comments. Does this sound reasonable?
(:commentboxchrono:)