[R-sig-Geo] newbie questions

Tom Sgouros tomfool at as220.org
Sun Nov 15 17:19:51 CET 2009


Hello all:

I'm trying to make some simple maps of election results and I am having
some trouble.  I'm hoping to use Grass (or QGis) to make the maps, but
apparently this requires getting my data into the shape files, and I
can't figure out how to do that.  I've found read.shape and that's
great, and I thought that by editing the resulting att.data data frame I
could do what I need.  Unfortunatly, if I use merge to combine my data
with the existing data, the data frame comes out sorted by the join
column and the output dbf file (done with write.dbf) doesn't work
properly with the shapefile because it's no longer sorted the same as
the outlines.

I tried preserving the original order of the data frame and re-sorting
the data frame before writing it out, and that worked, but the resulting
dbf file causes a seg fault in Grass when I try to read it with the rest
of the shape data.  Plus it seems a ridiculous amount of work for what
must be a fairly routine operation.

So here's my question: I have some data I want to add to a shape file
(the SHP, DBF, etc).  Can I use R maptools to do that easily, and if so,
how?

Many thanks in advance for the help,

 -tom


-- 
 --------------------------------------------------------
 Check out "Ten Things You Don't Know About Rhode Island"
     http://whatcheer.net      http://sgouros.com



More information about the R-sig-Geo mailing list