I'm new to R and do not know how to plot two data.frames with ggplot2. I get the following error message: Error: ggplot2 doesn't know how to deal with data of class uneval
How can I put together my data with the underlying world map?
Here is my code:
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)