Learn R Programming

Rfast (version 1.2)

The means of the columns and the rows : The means of the columns and the rows.

Description

The means of the columns and the rows.

Usage

colmeans(x)

Arguments

x
A numerical matrix with data.

Value

Returns a row vector with column means or a column vector with the row means.

See Also

colsums,rowsums,colMins,colMedians

Examples

Run this code
x <- matrix(rpois(1000 * 1000,10),ncol = 1000)
x1 <- colmeans(x)
x2 <- colMeans(x)
x1 == x2
x1 <- rowmeans(x)
x2 <- rowMeans(x)
x1 == x2

Run the code above in your browser using DataLab