Q. What will be the output of the following R code?
> x <- 6
> class(x)

  • (A) "integer"
  • (B) "numeric"
  • (C) "real"
  • (D) "imaginary"
πŸ’¬ Discuss
βœ… Correct Answer: (B) "numeric"

Q. What will be the Correct R code for the following output?
foo bar
1 1 TRUE
2 2 TRUE
3 3 FALSE
4 4 FALSE

  • (A) > x <- data.frame(foo = 1:4, bar = c(F, T, F, F)) > x
  • (B) > x <- data.frame(foo = 1:6, bar = c(F, T, F, F)) > x
  • (C) > x <- data.frame(foo = 1:4, bar = c(T, T, F, F)) > x
  • (D) > x <- data.frame(foo = 14:1, bar = c(F, T, F, F)) > x
πŸ’¬ Discuss
βœ… Correct Answer: (C) > x <- data.frame(foo = 1:4, bar = c(T, T, F, F)) > x

Q. . . . . . . . . function returns a vector of the same size as x with the elements arranged in increasing order.

  • (A) sort()
  • (B) orderasc()
  • (C) orderby()
  • (D) sequence()
πŸ’¬ Discuss
βœ… Correct Answer: (A) sort()

Q. R has how many atomic classes of objects?

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

Q. Point out the correct statement?

  • (A) The usual operator, <-, can be thought of as a syntactic shortcut to expression operation
  • (B) Assignment can also be made using the function assignment()
  • (C) Vectors can be used in arithmetic expressions, in which case the operations are performed element by element
  • (D) seq() is used to delete the numbers
πŸ’¬ Discuss
βœ… Correct Answer: (C) Vectors can be used in arithmetic expressions, in which case the operations are performed element by element

Q. Point out the wrong statement?

  • (A) matrices or more generally arrays are multi-dimensional generalizations of vectors
  • (B) factors provide compact ways to handle categorical data
  • (C) vectors provide a convenient way to return the results of a statistical computation
  • (D) lists can be explicitly created using the list() function
πŸ’¬ Discuss
βœ… Correct Answer: (C) vectors provide a convenient way to return the results of a statistical computation

Q. Locator function gives output as . . . . . . . .

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

Q. Numbers in R are generally treated as . . . . . . . . precision real numbers.

  • (A) single
  • (B) double
  • (C) real
  • (D) imaginary
πŸ’¬ Discuss
βœ… Correct Answer: (B) double

Q. To extract a sublist, we use . . . . . . . . brackets.

  • (A) Flower
  • (B) Square
  • (C) Double
  • (D) Single
πŸ’¬ Discuss
βœ… Correct Answer: (D) Single

Q. Using the . . . . . . . . vector, we create a species factor and bind it to the columns of iris.df.

  • (A) snames
  • (B) rnames
  • (C) jnames
  • (D) fnames
πŸ’¬ Discuss
βœ… Correct Answer: (A) snames