Remove duplicates and keep last in R Here is how to remove duplicates but keep the last row in the R data frame.