LoslegenKostenlos loslegen

Animating a scatterplot

Your task is to create an animated bubble chart of the state-level housing price index against real GDP from 1997 to 2017. Can you see the impact of the recession on the housing market?

The us_economy data set and plotly are already loaded into your R session.

Diese Übung ist Teil des Kurses

Intermediate Interactive Data Visualization with plotly in R

Kurs anzeigen

Anleitung zur Übung

  • Create an animated scatterplot over the years with gdp on the x-axis and house_price on the y-axis.
  • Color the markers by region.
  • Make the diameter of the markers proportional to the population.

Interaktive Übung

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

# Create an animated bubble chart of house_price against gdp
us_economy %>%
  ___(x = ___, y = ___) %>%
  ___(size = ___, color = ___, 
      frame = ___, ids = ___,
      marker = ___(___ = ___))
Code bearbeiten und ausführen