Q. What is the command used to store R objects in a file?

  • (A) save (x, file="x.Rdata")
  • (B) save (x, file=x.Rdata)
  • (C) save (x, file="x.Rdata");
  • (D) save (x, file="x.data")
πŸ’¬ Discuss
βœ… Correct Answer: (A) save (x, file="x.Rdata")

Q. Which of the following R code will print "Neither"?

  • (A) > y <- "meat" > switch(y, fruit = "banana", vegetable = "broccoli", "Neither")
  • (B) > y <- "brocolli" > switch(y, fruit = "banana", vegetable = "broccoli", "Neither")
  • (C) > y <- "banana" > switch(y, fruit = "banana", vegetable = "broccoli", "Neither")
  • (D) > y >- "banana" > y(y, fruit = "banana", vegetable = "broccoli", "Neither")
πŸ’¬ Discuss
βœ… Correct Answer: (A) > y <- "meat" > switch(y, fruit = "banana", vegetable = "broccoli", "Neither")

Q. . . . . . . . . function generates "n" normal random numbers based on the mean and standard deviation arguments passed to the function.

  • (A) rnorm
  • (B) vnorm
  • (C) knorm
  • (D) lnorm
πŸ’¬ Discuss
βœ… Correct Answer: (A) rnorm

Q. What will be the output of the following R code?
> x <- list(a = matrix(1:4, 2, 2), b = matrix(1:6, 3, 2))
> lapply(x, function(elt) { elt[,1] })

  • (A) $a [1] 1 2 $b [1] 1 2 3
  • (B) $a [1] 1 2 3 $b [1] 1 2 3
  • (C) $a [1] 1 2 3 $b [1] 1 2
  • (D) Error
πŸ’¬ Discuss
βœ… Correct Answer: (A) $a [1] 1 2 $b [1] 1 2 3

Q. . . . . . . . . is the easiest method for reshaping the data before analysis.

  • (A) Transpose()
  • (B) Structure()
  • (C) Package
  • (D) Function
πŸ’¬ Discuss
βœ… Correct Answer: (A) Transpose()

Q. R Commander is used to . . . . . . . . in R.

  • (A) Export data
  • (B) Import data
  • (C) Use data
  • (D) Work on data
πŸ’¬ Discuss
βœ… Correct Answer: (B) Import data

Q. R has . . . . . . . . basic indexing operators.

  • (A) two
  • (B) three
  • (C) four
  • (D) five
πŸ’¬ Discuss
βœ… Correct Answer: (B) three

Q. Which of the following code skips the first 20 iterations?

  • (A) for(i in 1:100) { if(i <= 20) { next } }
  • (B) for(i in 1:100) { if(i <= 19) { next } }
  • (C) for(i in 1:100) { if(i <= 21) { next } }
  • (D) for(i in 1:10) { if(i <= 24) { next } }
πŸ’¬ Discuss
βœ… Correct Answer: (A) for(i in 1:100) { if(i <= 20) { next } }

Q. If the function in a console is.matrix(X) returns true then X can be considered as a . . . . . . . .

  • (A) Matrix object
  • (B) Matrix data object
  • (C) Matrix vector
  • (D) Vector
πŸ’¬ Discuss
βœ… Correct Answer: (B) Matrix data object

Q. How is a Data object represented internally in R language?

  • (A) unclass (as.time ("2018-12-28"))
  • (B) unclass (as.dat ("2018-12-28"))
  • (C) unclass (as.D (2018-12-28))
  • (D) unclass (as.Date ("2018-12-28"))
πŸ’¬ Discuss
βœ… Correct Answer: (D) unclass (as.Date ("2018-12-28"))