Learn R Programming

svdvisual (version 1.1)

columnmean: Column mean matrix

Description

This function returns the column mean matrix of an input matrix

Usage

columnmean(x)

Arguments

x
The input matrix. Make sure this is a matrix object

Value

The column mean matrix

Details

This function calculates the mean of each column within the input matrix. If the matrix has dimension m x n, this function will return a m x n matrix, where each column has the same result, the average of the n elements in the corresponding column in the input matrix.

See Also

See Also in svd, apply, rowmean, doublemean, overallmean.

Examples

Run this code
#generate a random matrix
x<-matrix(rnorm(100), nrow=20);

#calculate the column mean matrix
y<-columnmean(x);
y

Run the code above in your browser using DataLab