Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/65.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/list/4.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 如何获得经纬度范围内的地图?_R_Ggplot2_Ggmap - Fatal编程技术网

R 如何获得经纬度范围内的地图?

R 如何获得经纬度范围内的地图?,r,ggplot2,ggmap,R,Ggplot2,Ggmap,如何在R中使用ggmap获得具有特定最小和最大纬度和经度限制的地图 我不熟悉使用ggmap,到目前为止,我能够实现以下功能: center <- c(mean(src$longitude),mean(src$latitude)) zoom <- min(MaxZoom(range(src$latitude),range(src$longitude))) hdf <- get_map(location=center,zoom=zoom) center我不确定您是否可以在下载阶段

如何在R中使用ggmap获得具有特定最小和最大纬度和经度限制的地图

我不熟悉使用ggmap,到目前为止,我能够实现以下功能:

center <- c(mean(src$longitude),mean(src$latitude))
zoom <- min(MaxZoom(range(src$latitude),range(src$longitude)))
hdf <- get_map(location=center,zoom=zoom)

center我不确定您是否可以在下载阶段完成,但在绘图阶段如何:

map <- get_map()
p1 <- ggmap( map )
p2 <- ggmap( map )+
scale_x_continuous( limits = c( -95.5 , -95.3 ) , expand = c( 0 , 0 ) )+
scale_y_continuous( limits = c( 29.6 , 29.8 ) , expand = c( 0 , 0 ) )
require( gridExtra )
grid.arrange( p1 , p2 , nrow = 1 )

map非常感谢。。这真的很有帮助。如果我们能在下载阶段完成,那就太好了。。但这对我来说是可行的:)您可以在get_map函数中提供一个更大的
zoom
变量(例如13),以获得更清晰的图像。