[R] Quantiles with ordered categories

matthias-gondan at gmx.de matthias-gondan at gmx.de
Tue Mar 14 20:36:28 CET 2017

Dear R users,

This works: 

quantile(1:10, probs=0.5)

This fails (obviously):

quantile(factor(1:10), probs=0.5)

But why do quantiles for ordered factors not work either?

quantile(ordered(1:10), probs=0.5)

Is it because interpolation (see the optional type argument) is not defined? Is there an elegant workaround?

Thank you.

Best wishes,


	[[alternative HTML version deleted]]

More information about the R-help mailing list