[R] value of nth percentile

Steve Lianoglou mailinglist.honeypot at gmail.com
Tue Aug 18 17:06:58 CEST 2009

Hi Ajay,

On Aug 18, 2009, at 8:16 AM, Ajay Singh wrote:

> Dear All,
> I have to get the value of say 90th percentile of precipitation time  
> series.. The series is of daily precipitation value of 96 years, I  
> have to to get 90the percentile value of daily precipitation each  
> year. If you know the R code or command for this please let me know.
> I would appreciate your early response.

R> dat <- rnorm(100, mean=10, sd=2)
R> quantile(dat, .9)

R> sum(dat < quantile(dat, .9)) / length(dat)
[1] 0.9


Steve Lianoglou
Graduate Student: Computational Systems Biology
   |  Memorial Sloan-Kettering Cancer Center
   |  Weill Medical College of Cornell University
Contact Info: http://cbio.mskcc.org/~lianos/contact

More information about the R-help mailing list