Clean and chart a dataset in R

8 steps · about 5 h 15 min · Beginner

  1. Learn R's basic syntax and objects (guide, R for Data Science (Wickham, Cetinkaya-Rundel, Grolemund), 20 min)

    Assignment, function calls and naming come first so later code makes sense.

  2. Read a CSV into a data frame (guide, R for Data Science (Wickham, Cetinkaya-Rundel, Grolemund), 40 min)

    Real analysis starts with getting messy files in and fixing column types.

  3. Filter, sort and summarise rows with dplyr (guide, R for Data Science (Wickham, Cetinkaya-Rundel, Grolemund), 1 h)

    The dplyr verbs answer most everyday questions about a dataset.

  4. Reshape data into tidy form (guide, R for Data Science (Wickham, Cetinkaya-Rundel, Grolemund), 45 min)

    Pivoting wide and long data unlocks both summaries and charts.

  5. Chart the cleaned data with ggplot2 (guide, R for Data Science (Wickham, Cetinkaya-Rundel, Grolemund), 50 min)

    With tidy data in hand, a layered grammar of graphics makes charts quick to iterate.

  6. Keep pipelines readable (guide, R for Data Science (Wickham, Cetinkaya-Rundel, Grolemund), 20 min)

    Consistent style and the pipe keep growing analysis scripts maintainable.

  7. Wrap repeated steps in functions (guide, R for Data Science (Wickham, Cetinkaya-Rundel, Grolemund), 45 min)

    Functions remove copy-paste once you repeat the same cleaning on several columns.

  8. Publish the analysis as a Quarto report (guide, R for Data Science (Wickham, Cetinkaya-Rundel, Grolemund), 35 min)

    Ending with a reproducible report turns code into something you can share.