Column and row-wise means of a matrix
Column and row-wise means of a matrix.
colmeans(x, parallel = FALSE) rowmeans(x) colhameans(x, parallel = FALSE) rowhameans(x)
x |
A numerical matrix with data. |
parallel |
Do you want to do it in parallel in C++? TRUE or FALSE. |
A vector with the column or row arithmetic or harmonic means.
Manos Papadakis
R implementation and documentation: Manos Papadakis <papadakm95@gmail.com>.
x <- matrix(rpois(100 * 100, 10),ncol = 100) x1 <- colmeans(x) x2 <- colMeans(x) all.equal(x1,x2) x1 <- rowmeans(x) x2 <- rowMeans(x) all.equal(x1,x2) system.time( colhameans(x) ) system.time( rowhameans(x) ) x<-x1<-x2<-NULL
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.