Q. Functions are defined using the . . . . . . . . directive and are stored as R objects.

  • (A) function()
  • (B) funct()
  • (C) functions()
  • (D) fun()
πŸ’¬ Discuss
βœ… Correct Answer: (A) function()

Q. MapReduce jobs submitted from either Oozie, Pig or Hive can be used to encode, improve and sample the data sets from . . . . . . . . into R.

  • (A) HDLS
  • (B) HDFS
  • (C) HDLSV
  • (D) HSSLV
πŸ’¬ Discuss
βœ… Correct Answer: (B) HDFS

Q. What will be the output of the following R code?
> y <- "fruit"
> switch(y, fruit = "banana", vegetable = "broccoli", "Neither")

  • (A) "banana"
  • (B) "Neither"
  • (C) "broccoli"
  • (D) Error
πŸ’¬ Discuss
βœ… Correct Answer: (A) "banana"

Q. Which of the following R code generate a sequence of integers from 1 to 10?

  • (A) > for(i in 1:9) { + print(i) + } [1]
  • (B) > for(i in 0:9) { + print(i) + } [1]
  • (C) > for(i in 1:10) { + print(i) + } [1]
  • (D) > for(i in 2:50) { + print("i") + } [1]
πŸ’¬ Discuss
βœ… Correct Answer: (C) > for(i in 1:10) { + print(i) + } [1]

Q. . . . . . . . . function is usually used inside another function and throws a warning whenever a particular package is not found.

  • (A) Dplyr
  • (B) Require
  • (C) Coin
  • (D) Sample
πŸ’¬ Discuss
βœ… Correct Answer: (B) Require

Q. What will be the output of the following R code snippet?
> lm <- function(x) { x * x }
> lm

  • (A) function(x) { x * x }
  • (B) func(x) { x * x }
  • (C) function(x) { x / x }
  • (D) function { x $ x }
πŸ’¬ Discuss
βœ… Correct Answer: (A) function(x) { x * x }

Q. Write the syntax to set the path of the current working directory in R environment?

  • (A) Setwd("dipath")
  • (B) Setwd(dir_path)
  • (C) Setwd("dir_path")
  • (D) Set("dir_path")
πŸ’¬ Discuss
βœ… Correct Answer: (C) Setwd("dir_path")

Q. Which of the following language supports lexical scoping?

  • (A) Perl
  • (B) Python
  • (C) Common Lisp
  • (D) All of the mentioned
πŸ’¬ Discuss
βœ… Correct Answer: (D) All of the mentioned

Q. What will be the value of following R expression?

  • (A) Warning in log(c(-1, 2)): NaNs produced
  • (B) Error in log(c(-1, 2)): NaNs produced
  • (C) Message
  • (D) All of the mentioned
πŸ’¬ Discuss
βœ… Correct Answer: (B) Error in log(c(-1, 2)): NaNs produced

Q. What will be the output of the following R code?
> x <- 3
> switch(6, 2+2, mean(1:10), rnorm(5))

  • (A) 10
  • (B) 1
  • (C) NULL
  • (D) 5
πŸ’¬ Discuss
βœ… Correct Answer: (C) NULL