Compute the sample medians of the columns (non-rows) of a data.frame or array.

1 | ```
colMedians( x, na.rm = FALSE )
``` |

`x` |
a data.frame or array. |

`na.rm` |
a logical value indicating whether |

A vector or array of the medians of each column (non-row) of `x`

with dimension `dim( x )[-1]`

.

Arne Henningsen

`rowMedians`

,`median`

,`colMeans`

.

1 2 3 4 5 6 7 8 9 | ```
data( "Electricity", package = "Ecdat" )
colMedians( Electricity )
a4 <- array( 1:120, dim = c(5,4,3,2),
dimnames = list( c("a","b","c","d","e"), c("A","B","C","D"),
c("x","y","z"), c("Y","Z") ) )
colMedians( a4 )
median( a4[ , "B", "x", "Z" ] ) # equal to
colMedians( a4 )[ "B", "x", "Z" ]
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

All documentation is copyright its authors; we didn't write any of that.