Check out example codes for "r extract top values from data frame". It will help you in understanding the concepts better.

Code Example 1

top_myvar <- head(arrange(df, desc(myvar)), n = 10)

Learn ReactJs, React Native from akashmittal.com