Creating Concentric circles using the ggmap function from GGMAP package R

المشرف العام

Administrator
طاقم الإدارة
i would like to create two concentric circles using the GGMAP package and ggmap function, one being 1/4 mile and the other 1 mile radius around the 16 metro rail stations in Los Angeles California. It looks like ggmaps doesn't scale the size in geom_point(aes(size=1)) to miles, so i would like to know how to convert this to miles. Thanks a lot. (I looked at the dismo package but i would like to use ggmaps to do this.)

======================================================================================== library(ggmap)

d = matrix(c(-118.2342, 34.05620, -118.2461, 34.05490, -118.2513, 34.04932, -118.2587, 34.04863, -118.2749, 34.05637, -118.2901, 34.06270, -118.2917, 34.07653, -118.2917, 34.08991, -118.2918, 34.09771, -118.3081, 34.10174, -118.3252, 34.10163, -118.3385, 34.10155, -118.3627, 34.14000, -118.3768, 34.16850, -118.3015, 34.06175, -118.3088, 34.06169),16,2,byrow=T)

colnames(d)=c("long","lat") d= data.frame(d)

m = get_map(location="Hollywood,California", maptype="roadmap",zoom = 12) la_map= ggmap(m)

HERE I WANT TO ADD A RADIUS OF 1 MILE and A RADIUS OF 1/4 MILE OVER THAT.

la_map+geom_point(aes(x = long, y = lat,size=1, col= "blue"),data = d)+ geom_point(aes(x = long, y = lat,size=1/4,col="red"),data = d)



أكثر...
 
أعلى