Row-/Colwise Medians similar to rowMeans
.
rowMedians(x, na.rm = FALSE)
colMedians(x, na.rm = FALSE)
matrix
logical(1)
, should NA
be removed?
numeric
, medians for each row/column.
m <- matrix(1:8, nrow = 2)
rowMedians(m)
#> [1] 4 5
colMedians(m)
#> [1] 1.5 3.5 5.5 7.5