我是 R 新手,不知道如何用 ggplot2 绘制两个 data.frames。我收到以下错误消息:Error: ggplot2 doesn't know how to deal with data of class uneval
如何将我的数据与底层世界地图放在一起?
这是我的代码:
require(Hmisc)
require(mapproj)
require(ggplot2)
require(rgdal)
require(maptools)
require(sp)
require(cshapes)
gpclibPermit()
world <- cshp(date=as.Date("2008-1-1"))
world.points <- fortify(world, region='COWCODE')
p <- ggplot(world.points, aes(long,lat,group=group)) + geom_polygon()
dat <- mdb.get("CLIWOC15_2000.mdb") # you can get the data from here: http://pendientedemigracion.ucm.es/info/cliwoc/cliwoc15.htm
tmp <- dat$CLIWOC15[,c("Lon3","Lat3")]
ggplot(world.points,aes(long,lat,group=group))
+geom_polygon()
+geom_point()
+geom_histogram(tmp,aes(Lon3,Lat3),alpha=0.01,size=1)
+coord_map()+ylim(-90,90)