9 Duplicates
It is very easy when inputting data to make mistakes, copy something in twice for example, or if someone did a lot of copy-pasting to assemble a spreadsheet (yikes!). We can check this pretty quickly
ImportantPenguin clean names dataset
9.1 Duplicated rows
[1] 0
Great! In our dataset we have no examples of duplicated rows of data
9.1.1 Working with duplications
As our dataset is duplication free, lets quickly add a few dupes to our data:
Your turn
If I did have duplications I could remove these with a few commands:
9.1.2 Counting unique entries
Using the n_distinct() function from dplyr, you can count the number of distinct values in an R data frame using one of the following methods.