Greetings!
 
I am trying to figure out how to order a data frame by one variable
conditioned on another. 
 
Here is an example of what I have:
 
d <- data.frame(RUN = rep(1:3, each = 3), ID = 1:9, AUC =
runif(9,1,100))
 
> d
RUN ID  AUC
  1    1    70.2
  1    2    86.5
  1    3    20.1
  2    4    74.3
  2    5    53.6
  2    6    67.6
  3    7    99.9
  3    8    47.3
  3    9    41.3

Here is what I want (data frame sorted by AUC within RUN):
 
> d
RUN ID  AUC
  1    3    20.1
  1    1    70.2
  1    2    86.5
  2    5    53.6
  2    6    67.6
  2    4    74.3
  3    9    41.3
  3    8    47.3
  3    7    99.9

Here is  my version info:
 
> version
               _                           
platform       i386-pc-mingw32             
arch           i386                        
os             mingw32                     
system         i386, mingw32               
status                                     
major          2                           
minor          7.2                         
year           2008                        
month          08                          
day            25                          
svn rev        46428                       
language       R                           
version.string R version 2.7.2 (2008-08-25)

 
Any thoughts you could provide would be greatly appreciated. Thanks and
have a great day!
 
Steve
 

Steve Riley, Pharm.D., Ph.D. 
Clinical Pharmacology, Specialty Neuroscience
Pfizer Specialty Care Business Unit
Mail Stop MS 6025-B2110 
50 Pequot Ave
New London, CT 06320

Steve.Riley@Pfizer.com 
Tel:  (860) 732-1796
Fax: (860) 686-5672

 

	[[alternative HTML version deleted]]


