mdb_data <- mdb_data[order(mdb_data$createDate),] mdb_data <- mdb_data[!duplicated(mdb_data$...id, fromLast = T),]