Solved

Order number largest to smallest R

Posted on 2013-12-16
3
998 Views
Last Modified: 2013-12-16
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
Comment
Question by:jay_eire
  • 2
3 Comments
 
LVL 37

Accepted Solution

by:
TommySzalapski earned 500 total points
ID: 39721437
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
 
LVL 7

Author Comment

by:jay_eire
ID: 39721457
Thanks for the reply. Is there an R dedicated section  on here? I could not find one.
0
 
LVL 37

Expert Comment

by:TommySzalapski
ID: 39721528
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

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
The viewer will learn how to count occurrences of each item in an array.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now