simple summary statistics

Dear all,

I would like to know the value of the top 1% and the top 99% of a variable. Just as a simple descriptive statistic of the data. This is probably easy, but I am trying to find this for over an hour now. Can someone please help me out.

The variable is numeric, a dollar amount for example.

x <- rnorm(1000)
quantile(x, c(0.01, 0.99))

Also, the tag for this shouldn't be tidyverse. general would be more appropriate.

Thank you! this works perfectly.

I am sorry, I may need something more.
What about the rank. So if I have 1000 observations, the value of observation 10 and 990?

Are they ordered?

If not you can sort them first.

sort(x)[c(10, 990)]

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.