ggplot2 - R - Plot sales volume on a map -


i'm trying plot volume of sales on map ggplot2 , ggmap. tried these lines, of course plot not right, because map darker have concentration of customers (but doesn't mean in places have higher sales volume):

ggmap(my.map,extent="device")+       stat_density2d(data=sales.data,aes(x=lon,y=lat,fill=..level..,alpha=..level..),          size=0.01,bins=20,geom="polygon")+ scale_fill_gradient(low = "green", high = "red")               +scale_alpha(range=c(0,0.3),guide=false) 

the dataset contains 3 columns: lon, lat , sales volume. i'd map "darker" near coordinates have greatest sales volume. there r function that?

thanks


Comments