Q. How is a character string defined in R?

  • (A) "Hello, World!"
  • (B) 'Hello, World!'
  • (C) c("Hello", "World")
  • (D) char("Hello, World!")
πŸ’¬ Discuss
βœ… Correct Answer: (A) "Hello, World!"

Q. What does the R function table() do?

  • (A) Creates a contingency table
  • (B) Displays the first few rows of a data frame
  • (C) Produces a summary of data
  • (D) Sorts a vector
πŸ’¬ Discuss
βœ… Correct Answer: (A) Creates a contingency table

Q. How is the data frame column Age selected in R?

  • (A) data$Age
  • (B) data[,"Age"]
  • (C) data[["Age"]]
  • (D) data.column("Age")
πŸ’¬ Discuss
βœ… Correct Answer: (B) data[,"Age"]

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

  • (A) Displays the search path for loaded packages
  • (B) Searches for a file in the working directory
  • (C) Searches for a keyword in the help
  • (D) Displays the search history
πŸ’¬ Discuss
βœ… Correct Answer: (A) Displays the search path for loaded packages

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

  • (A) mean(vector)
  • (B) calculate.mean(vector)
  • (C) vector.mean(vector)
  • (D) avg(vector)
πŸ’¬ Discuss
βœ… Correct Answer: (A) mean(vector)

Q. What does the R function read.csv() do?

  • (A) Print the CSV file
  • (B) Read data from a CSV file
  • (C) Create a CSV file
  • (D) Convert data to CSV format
πŸ’¬ Discuss
βœ… Correct Answer: (B) Read data from a CSV file

Q. How do you assign a value to a variable in R?

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

Q. Which of the following operators is used for exponentiation in R?

  • (A) **
  • (B) ^
  • (C) //
  • (D) %^%
πŸ’¬ Discuss
βœ… Correct Answer: (B) ^

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

  • (A) Open R documentation
  • (B) Display a help menu
  • (C) Start an interactive help system
  • (D) Load help files into memory
πŸ’¬ Discuss
βœ… Correct Answer: (C) Start an interactive help system

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

  • (A) Display a summary of data
  • (B) Print the source code of a function
  • (C) Generate a random sample
  • (D) Provide a summary statistics
πŸ’¬ Discuss
βœ… Correct Answer: (A) Display a summary of data