# How To Make Geographic Map Visualizations In R

Written by Matt Dancho

If you are explaining data related to geography or just want to visualize by latitude / longitude location, you need to know ggplot2 & the tidyverse for making maps.

This tutorial will show you how to make a publication-quality visualization! Here are the links to get set up. ðŸ‘‡

# SPECIAL ANNOUNCEMENT: ChatGPT for Data Scientists Workshop on December 13th

Inside the workshop Iâ€™ll share how I built a Machine Learning Powered Production Shiny App with ChatGPT (extends this data analysis to an insane production app):

What: ChatGPT for Data Scientists

When: Wednesday December 13th, 2pm EST

How It Will Help You: Whether you are new to data science or are an expert, ChatGPT is changing the game. Thereâ€™s a ton of hype. But how can ChatGPT actually help you become a better data scientist and help you stand out in your career? Iâ€™ll show you inside my free chatgpt for data scientists workshop.

Price: Does Free sound good?

How To Join: ðŸ‘‰ Register Here

# Video Tutorial

Learn how to make geospatial maps using the ggplot2 package in my 10-minute YouTube video tutorial.

# Working with Map Data

The first thing we need when creating a map is data that represents the latitude and longitude. We need to use a function called map_data() to collect the data in the right structure for a ggplot2 map.

Map Data

Using the map_data() function to collect lat/long data for the entire World.

Plotting the Map Data with ggplot2

We can use the geom_map() & coord_map() functions to plot the world.

# Visualizing Republican Voting

So what can we do with Map Data + ggplot2? How about visualizing how the US voted in 1976?!

# Conclusions

We learned how to make geospatial maps with ggplot2. Great work! But, thereâ€™s a lot more to becoming a data scientist.

If youâ€™d like to become a data scientist (and have an awesome career, improve your quality of life, enjoy your job, and all the fun that comes along), then I can help with that.

# Struggling to become a data scientist?

You know the feeling. Being unhappy with your current job.

Promotions arenâ€™t happening. Youâ€™re stuck. Feeling Hopeless. Confusedâ€¦

And youâ€™re praying that the next job interview will go better than the last 12â€¦

â€¦ But you know it wonâ€™t. Not unless you take control of your career.

The good news isâ€¦

Iâ€™ve helped 6,107+ students learn data science for business from an elite business consultantâ€™s perspective.

Iâ€™ve worked with Fortune 500 companies like S&P Global, Apple, MRM McCann, and more.

And I built a training program that gets my students life-changing data science careers (donâ€™t believe me? see my testimonials here):

# Whenever you are ready, hereâ€™s the system they are taking:

Hereâ€™s the system that has gotten aspiring data scientists, career transitioners, and life long learners data science jobs and promotionsâ€¦

P.S. - Samantha landed her NEW Data Science R Developer job at CVS Health (Fortune 500). This could be you.