[R] data vector to corresonding percentile ranks

Sarah Goslee sarah.goslee at gmail.com
Fri Dec 23 18:10:32 CET 2011


I'm not sure I understand the question, but does quantile() do what you want?

On Fri, Dec 23, 2011 at 10:28 AM, Steve Jones <sjones64 at jhmi.edu> wrote:
> I have a problem where I need to calculate the corresponding cohort
> percentile ranks for each of several variables.
>
> Essentially, what I need is a function that will calculate the
> distribution-free percentiles from each variable's data vector, returning a
> corresponding vector of percentiles:
>
> e.g.:
>
> percentile.my.data<-/function/(my.data)
>
>
> I tried to make ecdf() perform this task but was unsuccessful.
>
> I'd be grateful for any help or advice...
>
>


-- 
Sarah Goslee
http://www.functionaldiversity.org



More information about the R-help mailing list