我有这样的数据:
YEAR-STORM-DATETIME-NORTH-WEST-PRESSURE-WIND-SPEED-TRACKDATE
2011-arlene-6/28/2011 6:00-19.9-92.8-1007-30-NA-6/28/2011
2011-arlene-6/28/2011 12:00-20.3-93.1-1006-35-4-6/28/2011
2011-arlene-6/28/2011 18:00-20.7-93.5-1006-40-5-6/28/2011
so on..
我是 R 新手,我正在ggmap 上绘制密度图。我还使用闪亮的 R 在网站上显示它们。问题是输出都是非宽屏(平方)地图。我想要一个矩形地图,比如 Openlayers 或 KML 提供的谷歌地图。我的代码是:
library(ggplot2)
library(ggmap)
mydata <- read.csv("C:/R Data/Analytics/dMetrics.csv")
slice_year <- mydata[mydata$YEAR=='2009',]
map <- get_map(c(lon = -55.3632715, lat = 31.7632836), zoom = 3,
source = 'google', maptype = c("terrain"), messaging = FALSE,
color = 'color')
world <- ggmap(map) #extent = 'device'
world <- world +
stat_density2d(data = slice_year,
aes(x = WEST, y = NORTH, fill = ..level.., alpha = ..level..),
show_guide = FALSE, geom = "polygon", na.rm = TRUE) +
scale_fill_gradient(name = "Density", low = "maroon", high = "yellow",
guide = 'colorbar')
world
请指导我创建宽屏分辨率地图,可能是高分辨率。