Hi,

I am trying to calculate median() manually but it does not work for impaired lenghted vectors. What is wrong with my code?

```
median_function <- function(x)
{
odered <- sort(x)
if (IsWhole(length(odered)/2) == T) {
odered[length(odered)/2]
} else {
c(odered[(floor(length(odered)/2))],odered[(ceiling(length(odered)/2))])
}
}
median_function(my_matrix[,1])
```