Skip to course content
Free R data course

R Foundations for Data Analysis

Module 05 Knowledge Check

5 questions. Pass mark 4 out of 5. Answer every question before checking the answer key below, then retry after reading the feedback.

1. Two NAs in a visits column — one a form never submitted, one a closed ward — should be treated…

2. duplicated() on the whole table misses the duplicates that matter because…

3. Keeping validation results as a check column rather than filtering lets you…

4. Wrapping as.numeric() in suppressWarnings() is dangerous because…

5. dmy('01/03/2026') and mdy('01/03/2026') return…

---

Answer Key and Explanations

Check these only after attempting every question.

1. C — differently, because they mean different things

Filling both with zero asserts 'no visits happened' for both, and that is false for the ward whose form was never submitted.

2. B — repeated submissions differ in a timestamp or user column

A duplicate is a repeated key, not a repeated row. Count on the key instead.

3. B — count and inspect the failures before deciding

A filter removes the bad rows and the evidence together. Nobody upstream ever hears their system emits negative counts.

4. B — the warning was the only notice that data was being discarded

Unconvertible values silently become NA. Strip what you understand, convert, and flag what still fails.

5. B — dates two months apart

1 March and 3 January. The same eight characters, no error either way — which is why the format must be stated, never guessed.

Practical Check

Apply this module to your own work: complete the module activity for *Cleaning Data in R*, then write one sentence naming what your result shows and one naming what it does not.

Strong Answer Pattern

A strong answer names the task, the evidence used, the check performed, and the remaining limitation. It avoids "proved", "guaranteed", or "always" unless the evidence genuinely supports it.