LoslegenKostenlos loslegen

Color and size

In this example, you will continue exploring the World Happiness Report data set. So far you have explored how the relationship between happiness and life expectancy is mediated by income class and population. Your task is to explore how the region of the world mediates this relationship.

plotly has already been loaded for you, so there is no need to load it again.

After you create your graphic, be sure to explore the interactivity!

Diese Übung ist Teil des Kurses

Intermediate Interactive Data Visualization with plotly in R

Kurs anzeigen

Anleitung zur Übung

  • Create a scatterplot of happiness (on the y-axis) against life.expectancy (on the x-axis).
  • Use color to represent the region, and the size of the glyphs to represent log.gdp.

Interaktive Übung

Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.

# Create a coded scatterplot of happiness vs. life.expectancy
happy %>%
  ___(___, ___) %>%
  ___(___, ___)
Code bearbeiten und ausführen