Q. What will be the output of the following R code?
> x <- list(1, "a", TRUE, 1 + 4i)
> x

  • (A) [[1]] [1] 1 [[2]] [1] "a" [[3]] [1] TRUE [[4]] [1] 1+4i
  • (B) [[1]] [1] 2 [[2]] [1] "b" [[3]] [1] TRUE [[4]] [1] 1+4i
  • (C) [[1]] [1] 3 [[2]] [1] "a" [[3]] [1] TRUE [[4]] [1] 1+4i
  • (D) [[1]] [1] 77 [[2]] [1] "a" [[3]] [1] False [[4]] [1] 1+5i
πŸ’¬ Discuss
βœ… Correct Answer: (A) [[1]] [1] 1 [[2]] [1] "a" [[3]] [1] TRUE [[4]] [1] 1+4i

Q. What will be the output of the following R code?
> m <- matrix(1:4, nrow = 2, ncol = 2)
> dimnames(m) <- list(c("a", "b"), c("c", "d"))
> m

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

Q. Which of the following is used for reading tabular data?

  • (A) read.csv
  • (B) dget
  • (C) readLines
  • (D) writeline
πŸ’¬ Discuss
βœ… Correct Answer: (A) read.csv

Q. Point out the correct statement?

  • (A) The value NaN represents undefined value
  • (B) Number Inf represents infinity in R
  • (C) NaN can also be thought of as a missing value
  • (D) "raw" objects are commonly used directly in data analysis
πŸ’¬ Discuss
βœ… Correct Answer: (B) Number Inf represents infinity in R

Q. Computation with vectors is achieved using an element-by-element operation for avoiding . . . . . . . .

  • (A) Loops
  • (B) Functions
  • (C) Packages
  • (D) Interfaces
πŸ’¬ Discuss
βœ… Correct Answer: (A) Loops

Q. A data frame is a special type of list where every element of the list has . . . . . . . . length.

  • (A) Same
  • (B) Different
  • (C) May be different
  • (D) May be same
πŸ’¬ Discuss
βœ… Correct Answer: (A) Same

Q. A . . . . . . . . is a two-dimensional rectangular data set.

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

Q. Which function is used to combine the elements into a vector?

  • (A) C()
  • (B) D()
  • (C) E()
  • (D) F()
πŸ’¬ Discuss
βœ… Correct Answer: (A) C()

Q. By what function we can create data frames?

  • (A) Data.frames()
  • (B) Data.sets ()
  • (C) Function ()
  • (D) C ()
πŸ’¬ Discuss
βœ… Correct Answer: (A) Data.frames()

Q. Which of the following statement would print "0" "1" "2" "3" "4" "5" "6" for the following R code?
> x <- 0:6

  • (A) as.character(x)
  • (B) as.logical(x)
  • (C) as.numeric(x)
  • (D) as.num(y)
πŸ’¬ Discuss
βœ… Correct Answer: (A) as.character(x)