Skip to content
Prev 5188 / 29559 Next

mapping by zip codes

Hi,

You have to provide some more info in order for us to answer you 
question. How does 'your data' look like? A data.frame with x and y 
coordinates and more info? If this is correct, you need to convert the 
xy data.frame to a spatial object:

library(sp)
data(meuse) # data.frame
# The columns with the x and y coordinates are called "x" and "y"
coordinates(meuse) = ~x+y # SpatialPointsDataFrame

Then you can use overlay() to find out in which customer is in which 
polygon. Then you can count the number of customers per zip code.

cheers,
Paul

Alina Sheyman schreef: