我努力理解爲什麼會這樣:R中的平均值計算不正確?
a<-c(1.1,1.2,1.3)
b<-c(2.1,2.3,2.6)
c<-c(1.6,2.3,2.6)
mean<-rowMeans(matrix(c(a,b,c),ncol=3))
mean #### This are the mean values
[1] 1.600000 1.933333 2.166667
mean(a[1],b[1],c[1]) #### trying to calculate the mean of 1.1 ,2.1 and 1.6
[1] 1.1 #### Why is this not 1.6??
平均猴子... :) – zx8754 2014-09-04 15:22:15
我一直認爲猴子=真,但不知道肯定。現在已經確認。 – 2014-09-15 16:28:36