Skip to content
Prev 9958 / 29559 Next

Plot mean of variable on a map

Hello folks!

I'm trying to create some nice graphs for summary statistics in a
paper. Here is the issue.

I have shapefiles of St Petersburg, Russia, which I can import via

spb <- readShapePoly("/home/sasha/Documents/maps/spb.shp")

I also have data on apartments in the city. For each apartment, I have
the latitude, longitude, and the price.

I would like to plot the price on the map in a "heat" style plot. The
natural way to do this by computing a local average price for a
specified neighborhood around (Lat, Lon) (say, of 0.01 of a degree
across -- I have enough data to make this as fine as I need).

Does anyone have suggestions on the best way to do this?

Thanks!

Aleks

---------------
Aleksandr Andreev
Graduate Student -- Department of Economics
University of North Carolina at Chapel Hill