I have read a CSV file into an R data.frame. Some of the rows have the same element in one of the columns. I would like to remove rows that are duplicates in th
CSV
Here's a very simple, fast dplyr/tidy solution:
dplyr
tidy
Remove rows that are entirely the same:
library(dplyr) iris %>% distinct(.keep_all = TRUE)
Remove rows that are the same only in certain columns:
iris %>% distinct(Sepal.Length, Sepal.Width, .keep_all = TRUE)