Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1159
  • Last Modified:

Order number largest to smallest R

Hi,
I've imported a text file to R studio. The file contains numbers. how can I order my file by largest to smallest? And then select and display the top 10 biggest numbers?

The numbers are stored in a variable called V1.
0
jay_eire
Asked:
jay_eire
  • 2
1 Solution
 
TommySzalapskiCommented:
You want to sort in "descending" order
http://stat.ethz.ch/R-manual/R-devel/library/base/html/sort.html

Then use the "head" function to grab the top 10
http://rfunction.com/archives/699
0
 
jay_eireAuthor Commented:
Thanks for the reply. Is there an R dedicated section  on here? I could not find one.
0
 
TommySzalapskiCommented:
No there is not. The Miscellaneous Programming and Math & Science topic areas are where I would recommend posting R questions. I lot of the experts that I know who use R monitor those topics.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now