Q. What does the scan() function do in R?

  • (A) Read input from the console
  • (B) Read data from a file
  • (C) Perform a linear regression
  • (D) Generate random numbers
πŸ’¬ Discuss
βœ… Correct Answer: (B) Read data from a file

Q. What function is used to calculate the square root of a number in R?

  • (A) sqrt()
  • (B) squareRoot()
  • (C) sqrRoot()
  • (D) rootSquare()
πŸ’¬ Discuss
βœ… Correct Answer: (A) sqrt()

Q. In R, what does the function toupper("hello") return?

  • (A) "HELLO"
  • (B) "hello"
  • (C) "hElLo"
  • (D) "Hello"
πŸ’¬ Discuss
βœ… Correct Answer: (A) "HELLO"

Q. What is the result of sum(1:5) in R?

  • (A) 15
  • (B) 10
  • (C) 11
  • (D) 25
πŸ’¬ Discuss
βœ… Correct Answer: (A) 15

Q. How is the maximum value of a numeric vector calculated in R using the max() function?

  • (A) max(vector)
  • (B) maximum(vector)
  • (C) vectorMax(vector)
  • (D) max_value(vector)
πŸ’¬ Discuss
βœ… Correct Answer: (A) max(vector)

Q. In R, what does the function tolower("WORLD") return?

  • (A) "world"
  • (B) "WORLD"
  • (C) "wOrLd"
  • (D) "World"
πŸ’¬ Discuss
βœ… Correct Answer: (A) "world"

Q. What symbol is used for assignment in R?

  • (A) <-
  • (B) =
  • (C) ->
  • (D) assign()
πŸ’¬ Discuss
βœ… Correct Answer: (A) <-

Q. What does the function print() do in R?

  • (A) Display the result of a calculation
  • (B) Read input from the user
  • (C) Plot a graph
  • (D) Install a package
πŸ’¬ Discuss
βœ… Correct Answer: (A) Display the result of a calculation

Q. In R, how is a variable assigned a value?

  • (A) set
  • (B) =
  • (C) ->
  • (D) assign()
πŸ’¬ Discuss
βœ… Correct Answer: (A) set

Q. What is the purpose of the seq() function in R?

  • (A) Create a sequence of numbers
  • (B) Sort a vector
  • (C) Merge two data frames
  • (D) Compute the mean of a numeric vector
πŸ’¬ Discuss
βœ… Correct Answer: (A) Create a sequence of numbers