colMedians {miscTools}R Documentation

Medians of Columns and Rows

Description

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

Usage

colMedians( x, na.rm = FALSE )

rowMedians( x, na.rm = FALSE )

Arguments

x a data.frame or matrix.
na.rm a logical value indicating whether NA values should be stripped before the computation proceeds.

Value

A vector of the medians of each column or row of x.

Author(s)

Arne Henningsen

See Also

median,colMeans.

Examples

   data( "Electricity", package = "Ecdat" )
   colMedians( Electricity )

[Package miscTools version 0.6-0 Index]