mean(trim)

 
mean(trim)
去掉最大值和最小值后的平均数(Trim mean)
> s<-c(.25, 0.4, 1.00,2.00,3.00,4.00,5.00,8.00,12.00,50.00) > s [1]  0.25  0.40  1.00  2.00  3.00  4.00  5.00  8.00 12.00 50.00
> mean(s,trim=1/10) [1] 4.425
#####也就是去除s中的最大值最小值
等价于
> s<-c(.25,1.00,2.00,3.00,4.00,5.00,8.00,12.00) > mean(s) [1] 4.40625
#####
mean(s,trim=3/10)##去除s中的三对最大值最小值
原文地址:https://www.cnblogs.com/blueicely/p/2817818.html