7.4.6 R7. Visualization - Video 5: World Maps in R | Summary and Q&A

11.5K views
December 13, 2018
by
MIT OpenCourseWare
YouTube video player
7.4.6 R7. Visualization - Video 5: World Maps in R

TL;DR

Learn how to use the ggmap package to plot a world map and visualize the number of international students from each country at MIT.

Install to Summarize YouTube Videos and Get Transcripts

Questions & Answers

Q: What are the key steps involved in plotting a world map with international student data?

The key steps are installing and loading the ggmap package, loading the intlall.csv data set, cleaning the data, merging the world map and international student data frames, reordering the data, fixing naming inconsistencies, and plotting the map with different projections.

Q: Why is it important to clean the data and convert NAs to 0s?

Converting NAs to 0s ensures that missing data points are properly accounted for when plotting the map. Otherwise, the missing values could affect the accuracy and appearance of the visualization.

Q: How can naming inconsistencies between the MIT data frame and the world map data frame be resolved?

By identifying the naming differences (e.g., "China (People's Republic Of)" vs. "China") and changing the inconsistent names in the MIT data frame to match the world_map data frame, the datasets can be merged properly.

Q: What are some alternative projections that can be used for plotting the world map?

Besides the Mercator projection, an orthographic projection allows for a 3D-like view of the map as if looking at a globe. Other projections, such as Robinson, Albers, or Conic, can also be explored for different visual perspectives.

Summary & Key Takeaways

  • Use the ggmap package to plot a world map and load the international student data set (intlall.csv).

  • Clean the data by converting NAs to 0s and merge the world map data frame with the international student data frame.

  • Reorder the data in the correct order to prevent misplacement of country borders.

  • Fix naming inconsistencies between the MIT data frame and the world map data frame (e.g., changing "China (People's Republic Of)" to "China").

  • Plot the world map with different projections, such as Mercator and orthographic.

Share This Summary 📚

Summarize YouTube Videos and Get Video Transcripts with 1-Click

Download browser extensions on:

Explore More Summaries from MIT OpenCourseWare 📚

Summarize YouTube Videos and Get Video Transcripts with 1-Click

Download browser extensions on: