Description Usage Arguments Details Value Author(s) See Also

Calculates the median for each row (column) in a matrix.

1 2 3 4 5 |

`x` |
An NxK |

`rows, cols` |
A |

`na.rm` |
If |

`dim.` |
An |

`...` |
Not used. |

`useNames` |
If |

The implementation of `rowMedians()`

and `colMedians()`

is
optimized for both speed and memory. To avoid coercing to
`double`

s (and hence memory allocation), there is a
special implementation for `integer`

matrices. That is,
if `x`

is an `integer`

`matrix`

,
then `rowMedians(as.double(x))`

(`rowMedians(as.double(x))`

) would
require three times the memory of `rowMedians(x)`

(`colMedians(x)`

), but all this is avoided.

Returns a `numeric`

`vector`

of
length N (K).

Henrik Bengtsson, Harris Jaffee

See `rowWeightedMedians()`

and
`colWeightedMedians()`

for weighted medians.
For mean estimates, see `rowMeans2()`

and
`rowMeans()`

.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.