Q. Point out the correct statement?

  • (A) POSIX represents a portable operating system interface, primarily for UNIX systems
  • (B) There are different levels of indication that can be used, ranging from mere notification to fatal error
  • (C) The default input format for POSIX dates consists of the month, followed by the year and day, separated by slashes or dashes
  • (D) R don't have any way to indicate to you that something's not right
πŸ’¬ Discuss
βœ… Correct Answer: (A) POSIX represents a portable operating system interface, primarily for UNIX systems

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. What will be the output of the following R code?
> g <- function(x) {
+ a <- 3
+ x+a+y
+ ## 'y' is a free variable
+ }
> y <- 3
> g(2)

  • (A) 9
  • (B) 42
  • (C) 8
  • (D) Error
πŸ’¬ Discuss
βœ… Correct Answer: (C) 8

Q. What will be the output of the following R code snippet?
> g <- function(x) {
+ a <- 3
+ x+a+y
+ ## 'y' is a free variable
+ }
> g(2)

  • (A) 9
  • (B) 42
  • (C) 8
  • (D) Error
πŸ’¬ Discuss
βœ… Correct Answer: (D) Error

Q. What will be the output of the following R code?
> mean(x)
Error in mean(x) : object 'x' not found
> traceback()

  • (A) 1: mean(x)
  • (B) Null
  • (C) 0
  • (D) 2
πŸ’¬ Discuss
βœ… Correct Answer: (A) 1: mean(x)

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. Point out the correct statement?

  • (A) R has a number of ways to indicate to you that something's not right
  • (B) Executing any function in R may result in the condition
  • (C) "condition" is a generic concept for indicating that something unexpected has occurred
  • (D) All of the mentioned
πŸ’¬ Discuss
βœ… Correct Answer: (D) All of the mentioned

Q. What will be the output of the following R code?
> x <- c("a", "b", "c", "d")
> for(i in 1:4) {
+ ## Print out each element of 'x'
+ print(x[i])
+ }

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

Q. Point out the wrong statement?

  • (A) A formal argument can be a symbol, a statement of the form 'symbol = expression', or the special formal argument
  • (B) The first component of the function declaration is the keyword function
  • (C) The value returned by the call to function is not a function
  • (D) Functions are also often written when code must be shared with others or the public
πŸ’¬ Discuss
βœ… Correct Answer: (A) A formal argument can be a symbol, a statement of the form 'symbol = expression', or the special formal argument