Skip to content
Prev 307999 / 398503 Next

median between matrix column

Dear Eliza,

No problem.

In my solution, you can delete the sort() and get the same result.
?res1<-do.call(rbind,lapply(1:ncol(mat1[,-16]),function(i) median(stack(as.data.frame(mat1[,c(i,16)]))[,1])))
head(res1)
?# ??? [,1]
#[1,] 239.0
#[2,] 238.0
#[3,] 181.5
#[4,] 244.5
#[5,] 265.0
#[6,] 212.0
A.K.