1. 学习
  2. /
  3. 课程
  4. /
  5. Reshaping Data with tidyr

Connected

练习

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.

说明 1 / 共 2 个

undefined XP
    1
    2
  • Pivot bird_df to longer format so that an integer column points and a character column species are created. Use the names_prefix argument to clean up the points column and make sure no NA values remain.