title: Taking only the maximum values of duplicate IDs for all columns of a data frame in R
body: <p>I have data frame of 24525 rows and 22 columns. Last column is the ID column, other are numeric. Number of unique IDs is 18414 and some IDs are repeated more than 2 times.</p>
  <p>I need to remove duplicate IDs and keep only the maximum value for each ID and each column in another data frame.</p>
  <p>I tried sorting each column in a for loop and remove duplicates to keep the maximum but it did not work and I am not sure.</p>
  <p>Is anyone knows a way to do this task?</p>
  <p>Thank you in advance</p>