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

Connected

练习

Transposing planet data

You're again working on a planet dataset derived from the devstronomy project. This time, you're interested in the correlation between the diameter of a planet and the number of moons circling it.

However, the dataset (planet_df) has a row for each variable and a column for each planet (observation). You'll transpose this data in two steps and then create a plot to inspect the correlation.

The ggplot2 package has been pre-loaded for you.

说明 1 / 共 3 个

undefined XP
    1
    2
    3
  • Pivot the data so that planet names are put in a column named planet.