I have a data frame, which looks like that:
P1 P2 P3 T1 T2 T3 I1 I2 1 2 3 5 52 43 61 6 \"b\" 2 6 4 3 72 NA 59 1 \"a\" 3
The default sort is stable, so we sort twice: First by the minor key, then by the major key
rum1 <- rum[order(rum$I2, decreasing = FALSE),] rum2 <- rum1[order(rum1$I1, decreasing = TRUE),]