Module 05 Summary
What this module established
The first question about a missing value is why it is missing, not how to fill it. A form never submitted and a ward that was closed both show as NA and mean opposite things; filling both with zero asserts one of them for both.
Carry forward
- A duplicate is a repeated key, not a repeated row.
duplicated()finds only the perfectly identical ones, which are rarely the ones inflating your totals. - Keep validation as a check column so failures can be counted. Impossible values a rule can handle; implausible-but-legal ones need a human.
- Category columns split silently on whitespace and case. Run
count()before grouping and confirm the number of categories. - Declare factor levels for ordered categories and state the format when parsing dates —
01/03/2026is two different days.
Before moving on
Move on when your cleaning log accounts for every row that left the table.
