add column to matrix r code example
Example 1: sum columns r
colSums (x, na.rm = FALSE, dims = 1)
rowSums (x, na.rm = FALSE, dims = 1)
colMeans(x, na.rm = FALSE, dims = 1)
rowMeans(x, na.rm = FALSE, dims = 1)
Example 2: add row to matrix r
MatrixB <- rbind(MatrixA, c(10,11,12))