Learn R Programming

miscTools (version 0.6-28)

rowMedians: Medians of Rows

Description

Compute the sample medians of the rows of a data.frame or matrix.

Usage

rowMedians( x, na.rm = FALSE )

Value

A vector of the medians of each row of x.

Arguments

x

a data.frame or matrix.

na.rm

a logical value indicating whether NA values should be stripped before the computation proceeds.

Author

Arne Henningsen

See Also

colMedians,median,colMeans.

Examples

Run this code
   m <- matrix( 1:12, nrow = 4 )
   rowMedians( m )

Run the code above in your browser using DataLab