Median for Ordered Factors
Calculate the median for ordered factors. This is not implemented in standard R, as it's not well defined (it is not clear what to do if the median sits between two levels in factors of even length). This function returns the high median and prints a warning if the low median would be different (which is supposed to be a rare event).
"median"(x, na.rm = FALSE)
- an ordered factor containing the values whose median is to be computed.
- a logical value indicating whether
NAvalues should be stripped before the computation proceeds.
There's a vivid discussion between experts going on whether this should be defined or not. We'll wait for definitive results and enjoy the function's comfort so far...