НачатьНачать бесплатно

Mapping Senate winners, redux

In the last lesson you created a choropleth map for the Senate results using plot_geo() with a few workarounds. In this exercise, your task is to recreate that map from polygons. That is, create a U.S. map from polygons and fill in states based on the winner of the Senate race.

The senate_map data frame and plotly have already been loaded for you. senate_map contains the information you have seen previously, along with the boundary information needed to draw state polygons.

Это упражнение является частью курса

Interactive Data Visualization with plotly in R

Посмотреть курс

Интерактивное практическое упражнение

Попробуйте выполнить это упражнение, дополнив этот пример кода.

# Create a choropleth map displaying the Senate winners
senate_map %>%
  ___(___) %>%
  ___(___, ___, ___, ___) %>%
  add_polygons(line = ___(___), ___)
Редактировать и запускать код