Hi,
I gave the answer in my previous e-mail
library(sp)
data(meuse) # data.frame
# The columns with the x and y coordinates are called "x" and "y"
coordinates(meuse) = ~x+y # SpatialPointsDataFrame
A good source of additional information is the sp-documentation or the
book Applied Spatial Data
Dear Alina
First of all I suggest you search this mailing list, google, as well as
reading a little at http://r-spatial.sourceforge.net/
Especially the Graph gallery is useful with lots of examples. If you want to
advance, please look at http://www.asdar-book.org/
The answer to your question
My data consists of lat, long, and the number of customers associated with
each
How do I go about converting my data.frame to a spatial object?
On Tue, Mar 3, 2009 at 3:40 PM, Paul Hiemstra wrote:
> Hi,
>
> You have to provide some more info in order for us to answer you question.
> How does 'yo
ate is your US zip shape file, Google data is pretty accurate).
You should be able to figure out from this example what you have to do automate retrieval of coordinates from addresses:
http://spatial-analyst.net/wiki/index.php?title=Mapping_research_hot-spots#Geocoding_addresses
HTH
Tom Hengl
009 8:49 PM
To: R-sig-Geo@stat.math.ethz.ch
Subject: [R-sig-Geo] mapping by zip codes
I'm very new to creating maps using shapefiles, so this question might be
pretty basic.
I'm trying to create a map of the US, divided up by zip codes, where i then
map number of customers by zip code.
I locat
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 column
I'm very new to creating maps using shapefiles, so this question might be
pretty basic.
I'm trying to create a map of the US, divided up by zip codes, where i then
map number of customers by zip code.
I located shapefiles for US with zip codes (although at this point only for
individual states, an