## How to Calculate Mean / Average in R

To calculate a mean or average in R, you can “use the mean() function.” For example, mean(c(1, 2, 3, 4)) function returns 2.5. Syntax mean(x, trim, na.rm) Parameters x: The x is a Numeric Vector. trim: It drops some observations from both ends of the sorted vector. na.rm: It is a boolean value to ignore the NA … Read more