Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/apache-spark/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R ggmap中的经纬度定位不正确_R_Ggmap - Fatal编程技术网

R ggmap中的经纬度定位不正确

R ggmap中的经纬度定位不正确,r,ggmap,R,Ggmap,这个问题出现了,正如这里所说的,它是。但这似乎只得到了部分解决 首先,这是一个有效的代码,显示了一个大约位于白宫位置的点: require(ggmap) gc = geocode('the white house') qmap(location = "the white house", maptype = "roadmap", zoom = 3) + geom_point(aes(x = lon, y = lat), data = gc, color="red", size = 3) 然

这个问题出现了,正如这里所说的,它是。但这似乎只得到了部分解决

首先,这是一个有效的代码,显示了一个大约位于白宫位置的点:

require(ggmap)
gc = geocode('the white house')
qmap(location = "the white house", maptype = "roadmap", zoom = 3) +
   geom_point(aes(x = lon, y = lat), data = gc, color="red", size = 3)
然而,如果我将
maptype
改为
“toner”
,我更喜欢它的简单性和州际边界的清晰性,那么白宫就会北上,深入加拿大:

qmap(location = "the white house", maptype = "toner", zoom = 3) +
   geom_point(aes(x = lon, y = lat), data = gc, color="red", size = 3)

如何修复此问题?

看起来像个bug,但您可以使用gc变量geocde将位置设置为数字(lat,long)。我注意到,通过在
qmap
中设置
color=“bw”
,我可以在不使用
toner的情况下获得一些简单性。