Sort data frame by two columns (with condition) [duplicate]
问题 This question already has answers here : How to sort a dataframe by multiple column(s) (19 answers) Closed 4 years ago . I have the following data frame in R: DataTable <- data.frame( Name = c("Nelle","Alex","Thomas","Jeff","Rodger","Michi"), Age = c(17, 18, 18, 16, 16, 16), Grade = c(1,5,3,2,2,4) ) Name Age Grade 1 Nelle 17 1 2 Alex 18 5 3 Thomas 18 3 4 Jeff 16 2 5 Rodger 16 2 6 Michi 16 4 Now ill will sort this data frame by its Age column. No problem so far: DataTable_sort_age <- DataTable