s-news
[Top] [All Lists]

Re: sorting one column and having the other 2 move also

To: "Leeds, Mark" <mleeds@mlp.com>
Subject: Re: sorting one column and having the other 2 move also
From: "David L Lorenz" <lorenz@usgs.gov>
Date: Mon, 19 Jul 2004 07:44:03 -0500
Cc: s-news@lists.biostat.wustl.edu, s-news-owner@lists.biostat.wustl.edu
Mark,
  Take a look at sort.col.  I think that will do what you want.
Dave



                                                                                
                                                           
                      "Leeds, Mark"                                             
                                                           
                      <mleeds@mlp.com>                 To:       
<s-news@lists.biostat.wustl.edu>                                          
                      Sent by:                         cc:                      
                                                           
                      s-news-owner@lists.biosta        Subject:  [S] sorting 
one column and having the other 2 move also                   
                      t.wustl.edu                                               
                                                           
                                                                                
                                                           
                                                                                
                                                           
                      07/16/2004 11:08 PM                                       
                                                           
                                                                                
                                                           
                                                                                
                                                           




i have a dataframe with 3 columns

"name", "ticker" and "shares" which
are character, chracter and integer
respectively.

i want to sort the dataframe by
the first column : "name"
and have the other 2 columns
move along with the sorted
first column as you would expect.

i suspect it's not possible to do this so
i will have to sort the first column by
itself and then use some kind
of indexing thing in a loop
of some sort but i am
checking first before
i start dealing with this.


                    thanks.







<Prev in Thread] Current Thread [Next in Thread>