To Documents

Review Questions for R and Related Topics

Some questions ask for all the correct answers.

  1. What is the output?
    a. [1] 3 3 7   b. [1] 3 5 7   c. [1] 5 3 7   d. [1] 5 5 7
     
  2. What is the output?
    a. [1] -1    b. [1] 4    c. NULL    d. numeric(0)
     
  3. What is the output?
    a. [1] AppleMicrosoftSun          b. [1] "AppleMicrosoftSun"  
    c. [1] "Apple Microsoft Sun"   d. [1] "Apple" "Microsoft" "Sun"
     
  4. Which if statements are correct? There may be more than one correct answer.
  5. What is the output?
    a. Error: Missing {             b. 0
    c. 225                                            d. function(n) n^2
     
  6. What the output?
  7. Which statement prints the second element of this list named autos.  There may be more than one correct answer.
    a. autos[2]    b. autos$[[2]]    c. autos@cars    d. autos$cars
     
  8. Which of the following is correct for reading this file.  There may be more than one correct answer.
    a. auto >- read.csv("autosales2.txt")
    b. auto >- read.table("autosales2.txt")
    c. auto >- read.table("autosales2.txt", sep=",")
    d. auto >- read.table("autosales2.txt", sep=",", header=T)
     
  9. How many different algorithms are there for computing a percentile in R?
    a. 1      b. 3      c. 5      d. 8
     
  10. Which function returns the column names of a data frame?
    a. cols    b. columns    c. col.names    d. names
     
  11. What is the output?
    a. [1] 0.5000000   b. [1] 0.6826895   c. [1] 0.8413447   d. [1] 0.9772499
     
  12. What is default uniform random number generator for R?
    a. Knuth TAOCP    b. Mersenne Twister    c. Super Duper    d. Wichman Hill
     
  13. Which plot is produced by this statement:

     
  14. What is the theoretical covariance of x and y?
    a. 0      b. 9      c. 16     d. 25
     
  15. If x is a numeric vector, which of the following defines a QQ plot. There may be more than one right answer.
    a. qqnorm(x)    b. qqplot(x)     c. qqplot(1:length(x), x)    d. qqplot(rnorm(length(x)), x)