Learn R Programming

svdvisual (version 1.1)

overallmean: Global mean matrix

Description

This function returns the global mean matrix of an input matrix

Usage

overallmean(x)

Arguments

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

Value

The overall mean matrix

Details

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

See Also

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

Examples

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

#calculate the row mean matrix
y<-overallmean(x);
y

Run the code above in your browser using DataLab