I have a set of real numbers. I need to estimate the quantile of a new number. Is there any clean way to do this in R? in general?

I hope this is not ultra-trivial ;-)

Much appreciated for your response.

PK

As whuber pointed out, you can use ecdf, which takes a vector and returns a function for getting the percentile of a value.

> percentile <- ecdf(1:10)
> percentile(8)
[1] 0.8

