Aan de slagGa gratis aan de slag

New-Zealand's bird of the year

Every year New Zealanders vote en masse to decide which species gets the bird of the year trophy. The contest is organized by the Forest & Bird agency which allows each person to give points to up to five birds (first pick gets 5 points, second 4, …). Your job is to decide this year's winner from the messy dataset that's been pre-loaded for you as bird_df.

The dplyr package has been pre-loaded for you.

Deze oefening maakt deel uit van de cursus

Reshaping Data with tidyr

Cursus bekijken

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

bird_df %>%
  # Pivot the data to create a two column data frame
  ___(
    ___,
    names_to = ___,
    names_prefix = ___,
    names_transform = ___,
    values_to = ___,
    values_drop_na = ___
  )
Code bewerken en uitvoeren