[R] get the percentage rank of a value based on an empirical data vector

Martin Batholdy batholdy at googlemail.com
Wed Jan 11 14:12:55 CET 2012


Hi,

I have a vector with values:

x <- rnorm(1000, 5, 2)


and one single value:
y <- 6.2

now I would like to know the percent rank of y based on the 'population'-vector x.
Is there a convenient function that calculates the percent rank of a y for the given vector x?


thanks!


More information about the R-help mailing list