mean full signature
mean(x, trim = 0, na.rm = FALSE, ...)
| Argument | Meaning |
|---|---|
| x | Numeric vector |
| trim | % to trim off from both ends (e.g., trim = 0.1 removes top/bottom 10%) |
| na.rm | Remove NA values? (TRUE or FALSE) |
mean(c(1, 2, 3, 100)) # = 26.5 (skewed by 100)
mean(c(1, 2, 3, 100), trim = 0.25) # = 2.5 (trims 1 & 100)
mean(c(1, 2, NA)) # = NA
mean(c(1, 2, NA), na.rm = TRUE) # = 1.5