课程: Data Visualization in R with ggplot2
免费学习该课程!
今天就开通帐号,24,700 门业界名师课程任您挑!
Geocoding points
- [Instructor] As we work with map data, we often need to pinpoint specific locations on a map. You've already seen this work behind the scenes a few times with the qmap and get_map functions. We simply provided the name of a location and those functions pulled up the correct map of that area. Now, under the hood, those functions were performing an operation called geocoding. When we geocode a location, we convert it from a string to a latitude and longitude on the globe. There's no formula to do this, so R can't perform geocoding without some assistance. Fortunately, the ggmap package includes a geocoding function that uses Google Maps to perform geocoding. The geocode function takes a location name as input and returns the latitude and longitude of that location. Let's give it a try in R. I'll begin by geocoding New York City. I'm going to store in a variable called nyc the result of geocoding the location New York, New York. Now, when I look at the contents of that object, I can…
随堂练习,边学边练
下载课堂讲义。学练结合,紧跟进度,轻松巩固知识。
内容
-
-
-
-
-
-
(已锁定)
Visualizing data with maps2 分钟 14 秒
-
(已锁定)
Obtaining a Google Maps API key5 分钟 19 秒
-
(已锁定)
Working with map data2 分钟 32 秒
-
(已锁定)
Geocoding points3 分钟 26 秒
-
(已锁定)
Changing map types1 分钟 19 秒
-
(已锁定)
Plotting points on a map5 分钟 6 秒
-
(已锁定)
Building a map manually4 分钟 21 秒
-
(已锁定)
Creating a choropleth map6 分钟 53 秒
-
(已锁定)
-
-