Q. Which function is used to select variables and observations from a given dataset?

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

Q. Point out the correct statement?

  • (A) The search list can be found by using the searchlist() function
  • (B) The search list can be found by using the search() function
  • (C) The global environment or the user's workspace is always the second element of the search list
  • (D) R has separate namespaces for functions and non-functions
πŸ’¬ Discuss
βœ… Correct Answer: (B) The search list can be found by using the search() function

Q. Point out the wrong statement?

  • (A) Statements cannot be grouped together using braces '{' and '}'
  • (B) Computation in R consists of sequentially evaluating statements
  • (C) Single statements are evaluated when a new line is typed at the end of the syntactically complete statement
  • (D) next is used to skip an iteration of a loop
πŸ’¬ Discuss
βœ… Correct Answer: (A) Statements cannot be grouped together using braces '{' and '}'

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(1)

  • (A) Error
  • (B) Warning
  • (C) Messages
  • (D) 0
πŸ’¬ Discuss
βœ… Correct Answer: (A) Error

Q. . . . . . . . . is an indication that a fatal problem has occurred and execution of the function stops.

  • (A) message
  • (B) error
  • (C) warning
  • (D) message & warning
πŸ’¬ Discuss
βœ… Correct Answer: (B) error

Q. How many types of data structures does R language have?

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

Q. To get the current date, the . . . . . . . . function will return a Date object which can be converted to a different class if necessary.

  • (A) Sys.Time
  • (B) Sys.Date
  • (C) Sys.DateTime
  • (D) DateTime
πŸ’¬ Discuss
βœ… Correct Answer: (B) Sys.Date

Q. A matrix of scatterplots can be produced using . . . . . . . . function.

  • (A) Pears
  • (B) Pairs
  • (C) Tears
  • (D) Cars
πŸ’¬ Discuss
βœ… Correct Answer: (B) Pairs

Q. Point out the correct statement?

  • (A) In R, a function is an object which has the mode function
  • (B) R interpreter is able to pass control to the function, along with arguments that may be necessary for the function to accomplish the actions that are desired
  • (C) Functions are also often written when code must be shared with others or the public
  • (D) All of the mentioned
πŸ’¬ Discuss
βœ… Correct Answer: (D) All of the mentioned

Q. . . . . . . . . suspends the execution of a function wherever it is called and puts the function in debug mode.

  • (A) debug()
  • (B) trace()
  • (C) recover()
  • (D) browser()
πŸ’¬ Discuss
βœ… Correct Answer: (D) browser()