From raw data to presentable figures

Concluding practical

Author

Tyler McInnes

Published

October 16, 2026

1 Overview

In this concluding practical you will take a real dataset from raw data to one finished figure, using the skills from the workshop.

We will use the Many penguins dataset from TidyTuesday. It is similar to the Palmer penguins data you used on day 2, but it contains 18 penguin species instead of 3.

All of your work will answer one question:

Do penguin species with longer wings also have longer beaks?

You only need two of the measurement columns: wing.length and beak.length_culmen (beak length). Both are measured in mm. You can ignore the other measurement columns.

By the end you will have one Quarto file containing your code, a short written explanation of what you found, and one final figure saved as a .png file.

2 Setup

2.1 Create a new Quarto document called practical04.qmd and add it to your git repository.

2.2 Add a setup chunk that loads the tidyverse. Then import the data with read_csv() and store it in an object called many_penguins.

many_penguins <- read_csv("https://raw.githubusercontent.com/rfordatascience/tidytuesday/main/data/2026/2026-07-14/many_penguins.csv")
TipGit

Commit your work at the end of each section. Push your final version.

3 Get to know the data

Write your answers as text in your Quarto document, directly below the code.

3.1 How many rows and columns are there? What does one row represent?

3.2 How many penguins were measured for each species?

4 Find and remove outliers

Real data often contains mistakes. Penguins from the same genus usually have similar measurements, so on a plot their points sit close together. A point that sits far away from the rest of its group is called an outlier.

4.1 Make a scatter plot with wing.length on the x axis and beak.length_culmen on the y axis. Colour the points by genus. Can you see any points that are far away from the rest of their genus?

4.2 Use filter() to find the rows for the points in the bottom-right corner. Which species are they?

Hint: use the axes to choose your values, e.g., wing.length greater than … and beak.length_culmen less than …

4.3 Create a new object called penguins_clean. It should:

  • keep only the columns species, genus, wing.length and beak.length_culmen
  • remove penguins with a missing wing.length (hint: !is.na())
  • remove the four outliers you found

Below your code, write one or two sentences explaining why you removed the outliers.

Note

We cannot know for certain why a value is unusual. What matters is that you make a reasonable decision and write it down, so someone else can understand it.

5 Draft figure

Draft figures are for you, to help you interpret your own data. Keep them simple: no need for titles or a theme.

5.1 Make your scatter plot again, this time using penguins_clean. What is the relationship between wing length and beak length?

6 Summarise by species

6.1 Use group_by() and summarise() to create a new object called species_summary. It should have one row per species, with the number of penguins (n), the mean wing length, and the mean beak length.

Hint: group by both species and genus, so that genus is kept in your summary. You will need it to colour your final figure.

7 Final figure

7.1 Make a final figure from species_summary, with one point per species. Your figure must have:

  • mean wing length on the x axis and mean beak length on the y axis
  • points coloured by genus
  • axis labels that include the units (mm)
  • a title
  • a caption that says where the data comes from
  • a theme (e.g., theme_minimal())

Save your figure with ggsave() as penguins_final.png.

8 Conclusion

8.1 In 2–3 sentences, answer the question: do penguin species with longer wings also have longer beaks? Mention one limitation of your analysis (e.g., the small number of penguins per species).

9 Final checklist

Before you finish, check that: