Skip to course content
Free R data course

R Foundations for Data Analysis

Module 03 Activity

Scenario

A file has arrived from a system you do not control. Find out what is really in it before you use any of it.

What you build

An import script with declared types and missing markers, plus a data dictionary for the file.

Steps

  1. Read the file and record the types the import guessed. For any numeric column that arrived as text, find the value responsible.
  2. Declare the missing markers in the read itself rather than converting afterwards, then count the NAs the import produced.
  3. If the source is a spreadsheet, name the sheet explicitly and check the types afterwards rather than trusting the default read.
  4. Run all four inspections — head, glimpse, summary, count — and write one sentence about what each told you.
  5. Generate the mechanical half of a data dictionary, then write the meaning column yourself, naming what each column excludes.
  6. Save the cleaned object as RDS and export a CSV, then confirm which column types survive each round trip.

Evidence to hand in

Review checklist