相关疑难解决方法(0)

在地图上绘制坐标

我试图用R绘制我的坐标.我已经尝试过跟随不同的帖子(R:在世界地图上绘制分组坐标 ; 在R中的谷歌地图绘制多个点的坐标)但我的数据并没有太大成功.

我正在尝试使用我的gps坐标作为彩色圆点(每个区域为特定颜色)来获得世界的平面地图:

area         lat    long
Agullhas    -38,31  40,96
Polar       -57,59  76,51
Tasmanian   -39,47  108,93

library(RgoogleMaps)
lat <- c(-38.31, -35.50) #define our map's ylim
lon <- c(40.96,37.50) #define our map's xlim
center = c(mean(lat), mean(lon))  #tell what point to center on
zoom <- 2 #zoom: 1 = furthest out (entire globe), larger numbers = closer in
terrmap <- GetMap(center=center, zoom=zoom, maptype= "satallite", destfile = "satallite.png")
Run Code Online (Sandbox Code Playgroud)

问题,现在我不知道如何添加我的点,我想为每个区域一种颜色.

谁能帮助我继续前进呢?

我尝试过的另一个选择是:

library(maps)
library(mapdata)
library(maptools)
map(database= "world", ylim=c(-38.31, -35.5), xlim=c(40.96, 37.5), …
Run Code Online (Sandbox Code Playgroud)

maps google-maps r coordinates ggmap

34
推荐指数
2
解决办法
7万
查看次数

R ggplot2/ggmap同心圆为点

我试图绘制一些信息,显示完整的人口,然后在地图上按位置绘制该人口的子集.我已经看到使用同心圆或三维倒锥形的数据可视化来表达这一点.我只是无法弄清楚如何在ggplot/中ggmap

这是一个免费的手版本Paint,显示了我正在做的事情的粗略概念: 在此输入图像描述

这是一个例子的粗略数据:

> dput(df1)
structure(list(zip = c("00210", "00653", "00952", "02571", "04211", 
"05286", "06478", "07839", "10090", "11559"), city = c("Portsmouth", 
"Guanica", "Sabana Seca", "Wareham", "Auburn", "Craftsbury", 
"Oxford", "Greendell", "New York", "Lawrence"), state = c("NH", 
"PR", "PR", "MA", "ME", "VT", "CT", "NJ", "NY", "NY"), latitude = c(43.005895, 
17.992112, 18.429218, 41.751554, 44.197009, 44.627698, 41.428163, 
41.12831, 40.780751, 40.61579), longitude = c(-71.013202, -66.90097, 
-66.18014, -70.71059, -70.239485, -72.434398, -73.12729, -74.678956, 
-73.977182, -73.73126), timezone = c(-5L, -4L, -4L, -5L, -5L, 
-5L, …
Run Code Online (Sandbox Code Playgroud)

geocoding r geolocation ggplot2 ggmap

6
推荐指数
1
解决办法
3581
查看次数

用标签绘制空间坐标

我在R中是个新手。我有许多座标,我想以适当的方式在R中绘制它们,并显示标签。此外,轴应呈现纬度和经度。我尝试了ggplot,但无法将数据放入代码中。

   id      lon      lat
1   2 7.173500 45.86880
2   3 7.172540 45.86887
3   4 7.171636 45.86924
4   5 7.180180 45.87158
5   6 7.178070 45.87014
6   7 7.177229 45.86923
7   8 7.175240 45.86808
8   9 7.181409 45.87177
9  10 7.179299 45.87020
10 11 7.178359 45.87070
11 12 7.175189 45.86974
12 13 7.179379 45.87081
13 14 7.175509 45.86932
14 15 7.176839 45.86939
15 17 7.180990 45.87262
16 18 7.180150 45.87248
17 19 7.181220 45.87355
18 20 7.174910 45.86922
19 25 7.154970 45.87058 …
Run Code Online (Sandbox Code Playgroud)

plot r spatial ggplot2

1
推荐指数
1
解决办法
1816
查看次数

标签 统计

r ×3

ggmap ×2

ggplot2 ×2

coordinates ×1

geocoding ×1

geolocation ×1

google-maps ×1

maps ×1

plot ×1

spatial ×1