Another way is to use purrr package
# example data like what is said above
@A Handcart And Mohair
set.seed(1)
m <- data.frame(matrix(sample(100, 20, replace = TRUE), ncol = 4))
library(purrr)
means <- map_dbl(m, mean)
> means
# X1 X2 X3 X4
#47.0 64.4 44.8 67.8