Dear R Users! 
  I have a dataframe with duplicate cases. Var1 duplicated by var2.   
                                                                                
                var1                                                    var2    
                                                var3                            
                        var4                                                    
var5                                                    var6                    
                                                1                               
                        4                                                       
500                                                     1                       
                                2                                               
        a                                                                       
1                                                       3                       
                                200                                             
        2                                                       5               
                                        b                                       
                                1                                               
        8                                                       125             
                                        1                                       
                9                                                       b       
                                                                2               
                                        2                                       
                120                                                     2       
                                                52                              
                        b                                                       
                2                                                       9       
                                                400                             
                        1                                                       
22                                                      c                       
                                                2                               
                        6                                                       
22                                                      1                       
                                22                                              
        d                                                                       
3                                                       1                       
                                60                                              
        1                                                       54              
                                        s                                       
                                3                                               
        2                                                       65              
                                        1                                       
                21                                                      c       
                                                                3               
                                        3                                       
                62                                                      1       
                                                36                              
                        a                                                       
                4                                                       3       
                                                63                              
                        1                                                       
32                                                      a                       
  
  I want to delete duplicate ones from var1 which have low rank at var2, and 
keep that case which has highest rank at var2. I would like to keep the Whole 
row (with the other variables: 
                                                                                
                var1                                                    var2    
                                                var3                            
                        var4                                                    
var5                                                    var6                    
                                                1                               
                        8                                                       
125                                                     1                       
                                9                                               
        b                                                                       
2                                                       9                       
                                400                                             
        1                                                       22              
                                        c                                       
                                3                                               
        3                                                       62              
                                        1                                       
                36                                                      a       
                                                                4               
                                        3                                       
                63                                                      1       
                                                32                              
                        a                         
  Thanks Ag

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to