Take any random dataset:
data = rnorm(100)
I want to get a list of the largest 5% of values in this data. If I try:
quantile(data, .95)
...then I get the single value at the 95th percentile. If I try:
quantile(data, probs=c(1, .95))
...then I get only two values: the largest value in the dataset and the value at the 95th percentile. If I try:
quantile(data, 1 - .95)
...then I get the single value at the 5th percentile. If I try:
quantile(data, >.95)
...then I get a syntax error message.
How do I get a list of all values within a given quantile range? (In this case how do I get a list of all values that fall between the 100th and 95th percentiles?)