arrow
arrow
arrow
Which of the following inbuilt functions in R is used to calculate the mean of a numeric vector?
Question



Which of the following inbuilt functions in R is used to calculate the mean of a numeric vector?

A.

mean()

B.

avg()

C.

median()

D.

summarize()

E.

aggregate()

Correct option is A

In R, the mean() function is used to calculate the arithmetic mean of a numeric vector. It takes a numeric vector as input and returns the mean value, which is the sum of the elements divided by the total number of elements.
Example:

Important Key Points:
1. The mean() function is an inbuilt function in R used to calculate the average value of a vector.
2. It handles NA values by using the argument na.rm = TRUE. Example:

3. It is a part of R’s core statistical functions and does not require additional libraries.
Knowledge Booster:
· avg(): This is not a valid function in R for calculating the mean.
· median(): This calculates the median (middle value) of a vector, not the mean. Example: median(c(10, 20, 30)) gives 20.
· summarize(): This is used in the dplyr package for creating summaries of data, but not specifically for calculating the mean.
· aggregate(): Used for summarizing data by groups, typically in data frames or lists, but requires explicit specification of operations like mean.

Free Tests

Free
Must Attempt
Video Solutions

RBI Assistant Pre 2026 Full Mock Test -01

languageIcon English
  • pdpQsnIcon100 Questions
  • pdpsheetsIcon100 Marks
  • timerIcon60 Mins
languageIcon English
Free
Must Attempt
Video Solutions

RBI Asst Prelims 2026 : Reasoning Section Test 01

languageIcon English
  • pdpQsnIcon35 Questions
  • pdpsheetsIcon35 Marks
  • timerIcon20 Mins
languageIcon English
Free
Must Attempt
Video Solutions

RBI Office Attendant 2026 Full Mock Test - 01

languageIcon English
  • pdpQsnIcon120 Questions
  • pdpsheetsIcon120 Marks
  • timerIcon90 Mins
languageIcon English
test-prime-package

Access ‘SEBI Grade-A Assistant Manager’ Mock Tests with

  • 60000+ Mocks and Previous Year Papers
  • Unlimited Re-Attempts
  • Personalised Report Card
  • 500% Refund on Final Selection
  • Largest Community
students-icon
353k+ students have already unlocked exclusive benefits with Test Prime!
Our Plans
Monthsup-arrow