I do not understand all the terminology inside R. I have only 100 level statistics, trying to learn more.
I am guessing R has a built-in percentile function named something I don’t recognize or know how to search for.
I can write my own, but rather use the built in one for obvious reasons.
Here’s the one I wrote:
percentile <- function(x) return((x - min(x)) / (max(x) - min(x))
If you are looking to find out specific percentiles from a data set, take a look at the
quantilefunction:?quantile. By multiplying by 100, you get percentiles.If you are looking into converting numbers to their percentiles, take a look at
rank, though you will need to determine how to address ties. You can simply rescale from rank to quantile by dividing by the length of the vector.