Computes the (arithmetic) mean value for each column in a matrix or a data frame.

ct_meanCol(x)

Arguments

x

A matrix or a data frame.

Value

An n x 1 matrix with the mean value for each column in x. The rownames are the colnames of x.

Examples

dataTest=cbind(c(10,50,12,43), c(100, 101, 102, 103), c(1, 1, 5,4))
colnames(dataTest)=c("Variable 1", "Variable 2", "Variable 3")
ct_meanCol(dataTest)
#>              Mean
#> Variable 1  28.75
#> Variable 2 101.50
#> Variable 3   2.75