Say I have the following vector:
m<-c(11, 14, 11, 12, 11, 12, 9, 12, 12, 9, 12, 8, 11, 12, 10)
From this, it is easy to determine which number corresponds to a certain percentile, which has been demonstrated before (see: Link 1 or Link 2). For example, if I wanted to know which number is at the 14th percentile I could write something along the following lines:
quantile(m, c(.14)) # this yields 9 as outcome
What do I do, however, if I already know the number (here: 9) and what to know which percentile of the given data this is? In other words, is there a way in R that allows me to determine which percentile of my data the number 9 corresponds to? Of course I can do this by manually changing the percentile until it corresponds with the desired number, but that seems quite cumbersome. Is there perhaps a more efficient way?