VOOZH about

URL: https://www.geeksforgeeks.org/r-language/calculate-arithmetic-mean-in-r-programming-mean-function/

⇱ Calculate Arithmetic mean in R Programming - mean() Function - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Calculate Arithmetic mean in R Programming - mean() Function

Last Updated : 15 Jul, 2025
mean() function in R Language is used to calculate the arithmetic mean of the elements of the numeric vector passed to it as argument.
Syntax: mean(x, na.rm) Parameters: x: Numeric Vector na.rm: Boolean value to ignore NA value
Example 1: Output:
[1] 3.5
[1] 2.85
[1] -3.5
Example 2: Output:
[1] NA
[1] 2.75
Comment
Article Tags:

Explore