mean(x, trim = 0, na.rm = F)
When trim is positive, approximately trim*length(x) largest values and trim*length(x) smallest values are ignored; the mean of the remaining values is returned. When trim=.25, the result is often called the "midmean".
algebra <- testscores[,3] # vector of 25 algebra testscores mean(algebra) # Computes the average (in double precision) mean(algebra, trim = .1) # Computes the 10% trimmed mean of scoresapply(testscores, 2, mean) # vector of the means of the columns of scores