Appendix C. Answers to Quizzes

Question 1-1
R is an open source reworking of the S programming language.
Question 1-2
Choices include imperative, object-oriented, and functional.
Question 1-3
8:27
Question 1-4
help.search (which does the same as ??)
Question 1-5
RSiteSearch
Question 2-1
%/%
Question 2-2
all.equal(x, pi) or, even better, isTRUE(all.equal(x, pi))
Question 2-3

At least two of the following:

  1. <-
  2. + =
  3. + <<-
  4. assign
Question 2-4
Just Inf and -Inf
Question 2-5
0, Inf, and -Inf
Question 3-1
numeric, integer, and complex
Question 3-2
nlevels
Question 3-3
as.numeric("6.283185")
Question 3-4
Any three of summary, head, str, unclass, attributes, or View. Bonus points if you’ve discovered tail, the counterpart to head that prints the last few rows.
Question 3-5
rm(list = ls())
Question 4-1
seq.int(0, 1, 0.25)
Question 4-2
Either by using name = value pairs when the vector is created, or by calling the names function afterward.
Question 4-3
Positive integers for locations to retrieve, negative integers for locations to avoid, logical values, or names of elements.
Question 4-4
3 * 4 * 5 = 60
Question 4-5
%*%
Question 5-1
3. The inner list counts as one element, and so does the NULL element.
Question 5-2
When passing arguments to functions, when calling formals, or in the global environment variable .Options.
Question 5-3
You can use matrix-style indexing with pairs of positive integers/negative integers/logical values/characters in ...

Get Learning R now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.