Learn R Programming

micEcon (version 0.5-22)

colMedians: 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.

See Also

median,colMeans.

Examples

Run this code
data( "germanFarms" )
   colMedians( germanFarms[ , -1 ] )

Run the code above in your browser using DataLab