Q. Point out the correct statement?

  • (A) lapply() takes elements of the list and passes them as the first argument of the function you are applying
  • (B) You can use lapply() to evaluate a function multiple times each with a different argument
  • (C) Functions that you pass to lapply() may have other arguments
  • (D) None of the mentioned
πŸ’¬ Discuss
βœ… Correct Answer: (D) None of the mentioned

Q. What will be the output of the following R code?
> printmessage <- function(x) {
+ if(x > 0)
+ print("x is greater than zero")
+ else
+ print("x is less than or equal to zero")
+ invisible(x)
+ }
> printmessage(NA)

  • (A) Error
  • (B) Warning
  • (C) Messages
  • (D) x is greater than zero
πŸ’¬ Discuss
βœ… Correct Answer: (A) Error

Q. A . . . . . . . . in R programming language can also contain numeric and alphabets along with special characters like dot and underline.

  • (A) Variable name
  • (B) Number
  • (C) Integer
  • (D) Character
πŸ’¬ Discuss
βœ… Correct Answer: (A) Variable name

Q. What will be the output of the following R code?
> nLL <- make.NegLogLik(normals, c(FALSE, 2))
> optimize(nLL, c(-1, 3))$minimum

  • (A) 1.217775
  • (B) 2.217775
  • (C) 3
  • (D) empty
πŸ’¬ Discuss
βœ… Correct Answer: (D) empty

Q. How do you create log linear models in R language?

  • (A) loglm()
  • (B) logmn()
  • (C) logfn()
  • (D) loghy()
πŸ’¬ Discuss
βœ… Correct Answer: (A) loglm()

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

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

Q. What will be the output of the following R code snippet?
> f <- function(num = 1) {
+ hello <- "Hello, world!\n"
+ for(i in seq_len(num)) {
+ cat(hello)
+ }
+ chars <- nchar(hello) * num
+ chars
+ }
> f()

  • (A) Hello, world! [1] 14
  • (B) Hello, world! [1] 15
  • (C) Hello, world! [1] 16
  • (D) Error
πŸ’¬ Discuss
βœ… Correct Answer: (A) Hello, world! [1] 14

Q. . . . . . . . . function can be used to select the random sample of size 'n' from a huge dataset.

  • (A) Simple()
  • (B) Sample()
  • (C) While()
  • (D) Signal()
πŸ’¬ Discuss
βœ… Correct Answer: (B) Sample()

Q. . . . . . . . . package in R language provides various options for re-randomization and permutations based on statistical tests.

  • (A) Coin
  • (B) Vain
  • (C) Join
  • (D) Lain
πŸ’¬ Discuss
βœ… Correct Answer: (A) Coin

Q. . . . . . . . . can be used for storing the data for long-term.

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