Thanks a lot Jim, Dennis. Jim, actually where "dots" were I meant "etcetera" or "similar data". ;) My output is close to that one Dennis proposed with function aggregate, but i would like to keep the column var2 and the rest of columns with the unique value corresponding to var1 greatest value, So suppose the example is:
var1 var2 varN 122 nnn1 1 213 nnn2 2 422 nnn4 2 432 nnn5 3 441 nnn6 4 550 nnn7 4 500 nnn8 4 The output were: var1 var2 varN 122 nnn1 1 635 nnn4 2 432 nnn5 3 550 nnn7 4 Maybe that´s the reason for what I want to keep the "indexes" where the conditions are satisfied ( unique varN, sum of var1 were varN are the same, and value of var1 that is the greatest relative to the others same-VarN values). Thanks for your help! Chriss Paúl. [[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.