我知道如何使用ggplot()连接点:
dd <- data.frame(a=c(21.01223,18.45598,17.04542,19.44312),b=c(52.22968,51.75925,50.12482, 51.78745),
g=rep(1:2,2))
library(ggplot)
ggplot(data=dd,aes(x=a,y=b,group=g)) +
geom_point(col=rep(c("darkred","black"),each=2),size=5)+
geom_line(linetype=3)
但如何在谷歌地图上加入这一点? 我只能画点,但如何加入?
library(ggmap)
qmap('Poland',zoom=6) +
geom_point(data=dd,aes(x=a,y=b),col=rep(c("darkred","black"),each=2),size=5)