शुरू करेंमुफ़्त में शुरू करें

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.

यह अभ्यास पाठ्यक्रम का हिस्सा है

Reshaping Data with tidyr

पाठ्यक्रम देखें

इंटरैक्टिव व्यावहारिक अभ्यास

इस अभ्यास को इस नमूना कोड को पूरा करके आज़माएँ।

planet_df %>%
  # Pivot all columns except metric to long format
  ___
कोड संपादित करें और चलाएँ