Have a serious look at the section Type of r.help("quantile"). Quantile estimation from a sample is non a trivialproblem, and has caused ink overflows by the barrel...