Q. In R, how is the minimum value of a numeric vector calculated using the min() function?

  • (A) min(vector)
  • (B) minimum(vector)
  • (C) vectorMin(vector)
  • (D) min_value(vector)
πŸ’¬ Discuss
βœ… Correct Answer: (A) min(vector)

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

  • (A) Reverse the order of elements
  • (B) Remove duplicate elements
  • (C) Rotate elements to the right
  • (D) Sort elements in descending order
πŸ’¬ Discuss
βœ… Correct Answer: (A) Reverse the order of elements

Q. How do you create a vector of logical values in R?

  • (A) c(TRUE, FALSE, TRUE)
  • (B) vector(TRUE, FALSE, TRUE)
  • (C) logical_vector(TRUE, FALSE, TRUE)
  • (D) create_logical_vector(TRUE, FALSE)
πŸ’¬ Discuss
βœ… Correct Answer: (A) c(TRUE, FALSE, TRUE)

Q. In R, what does the abs() function do?

  • (A) Return the absolute values of elements
  • (B) Compute the average of elements
  • (C) Calculate the square root
  • (D) Find the maximum value
πŸ’¬ Discuss
βœ… Correct Answer: (A) Return the absolute values of elements

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

  • (A) Remove duplicate elements from a vector
  • (B) Identify unique elements in a vector
  • (C) Create a vector of unique values
  • (D) Find the maximum unique value
πŸ’¬ Discuss
βœ… Correct Answer: (A) Remove duplicate elements from a vector

Q. How do you create a vector of characters in R?

  • (A) c("apple", "banana", "cherry")
  • (B) char_vector("apple", "banana", "cherry")
  • (C) vector("apple", "banana", "cherry")
  • (D) create_char_vector("apple", "banana")
πŸ’¬ Discuss
βœ… Correct Answer: (A) c("apple", "banana", "cherry")

Q. What is the role of the rep() function in R?

  • (A) Repeat elements of a vector
  • (B) Replace missing values
  • (C) Remove duplicate elements
  • (D) Reverse the order of elements
πŸ’¬ Discuss
βœ… Correct Answer: (A) Repeat elements of a vector

Q. How do you check the data type of a variable in R?

  • (A) typeof(var)
  • (B) class(var)
  • (C) type(var)
  • (D) checkType(var)
πŸ’¬ Discuss
βœ… Correct Answer: (B) class(var)

Q. What is the output of 5 %% 2 in R?

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

Q. In R, how do you round a numeric value to the nearest integer using the round() function?

  • (A) round(5.78)
  • (B) round_to_int(5.78)
  • (C) round_up(5.78)
  • (D) round_down(5.78)
πŸ’¬ Discuss
βœ… Correct Answer: (A) round(5.78)