Skip to content
Prev 307983 / 398503 Next

median between matrix column

m<-matrix(1:10,ncol=5)
[,1] [,2] [,3] [,4] [,5]
[1,]    1    3    5    7    9
[2,]    2    4    6    8   10

apply(m,2,function(x){median(x,m[,5])})
[1] 5.5 6.5 7.5 8.5 9.5

Though i am not 100% sure thats what you mean. But the median of each row between two columns kind of doesn't make much sense to me, its only 2 values then after all.
On 15.10.2012, at 14:20, eliza botto wrote: