Q. What will be the output of the following R code?
> x <- list(a = 1:4, b = rnorm(10), c = rnorm(20, 1), d = rnorm(100, 5))
> lapply(x, mean)

  • (A) $a [1] 2.5 $b [1] 1.248845 $c [1] 1.9935285 Loop Functions 90 $d [1] 5.051388
  • (B) $a [1] 2.5 $b [1] 0.248845 $c [1] 0.9935285 Loop Functions 90 $d [1] 5.051388
  • (C) $a [1] 3.5 $b [1] 0.248845 $c [1] 0.9935285 Loop Functions 90 $d [1] 5.051388
  • (D) Error
πŸ’¬ Discuss
βœ… Correct Answer: (B) $a [1] 2.5 $b [1] 0.248845 $c [1] 0.9935285 Loop Functions 90 $d [1] 5.051388

Q. The . . . . . . . . function takes a vector or other objects and splits it into groups determined by a factor or list of factors.

  • (A) apply()
  • (B) lsplit()
  • (C) split()
  • (D) mapply()
πŸ’¬ Discuss
βœ… Correct Answer: (C) split()

Q. The . . . . . . . . function is used to plot negative likelihood.

  • (A) plot()
  • (B) graph()
  • (C) graph.plot()
  • (D) plot.graph()
πŸ’¬ Discuss
βœ… Correct Answer: (A) plot()

Q. lappy functions takes . . . . . . . . arguments in R language.

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

Q. Which function is more verbose?

  • (A) Lapply
  • (B) Japply
  • (C) Vapply
  • (D) Zapply
πŸ’¬ Discuss
βœ… Correct Answer: (C) Vapply

Q. The . . . . . . . . function returns a list of all the formal arguments of a function.

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

Q. What will be the output of the following R code?
> x <- list(a = 1:4, b = rnorm(10), c = rnorm(20, 1), d = rnorm(100, 5))
> sapply(x, mean)

  • (A) a b c d 2.500000 -0.251483 1.481246 4.968715
  • (B) a b c d 2.500000 -3.251483 2.481246 5.968715
  • (C) a b c d 3.500000 0.251483 1.481246 4.968715
  • (D) Error
πŸ’¬ Discuss
βœ… Correct Answer: (A) a b c d 2.500000 -0.251483 1.481246 4.968715

Q. Which function is used to create a histogram for visualisation in R programming language?

  • (A) Library
  • (B) Hist
  • (C) Data
  • (D) Refer
πŸ’¬ Discuss
βœ… Correct Answer: (B) Hist

Q. . . . . . . . . function is used to apply an expression for a given dataset.

  • (A) This()
  • (B) With()
  • (C) Unwith()
  • (D) That()
πŸ’¬ Discuss
βœ… Correct Answer: (B) With()

Q. . . . . . . . . function is used in applying a function each level of factors.

  • (A) With()
  • (B) By()
  • (C) To()
  • (D) Here()
πŸ’¬ Discuss
βœ… Correct Answer: (B) By()