[R-sig-Geo] Join Spatial Polygons to data.frame in R?

Yuri Zhukov zhukov.yuri at gmail.com
Tue Jun 9 05:54:08 CEST 2009


All,

Is there a function in R similar to "Join attributes from a table" in ArcGIS
9x? I am trying to join a SpatialPolygonsDataFrame (created from an ESRI
shapefile) to a data.frame which has the same unique ID, but contains some
missing values. As a result of the missing data issues, neighbor objects
created from the SpatialPolygonsDataFrame  -- particularly contiguity
neighbors that require polygons to remain intact -- are of different length
than the number of rows in the data.frame and spatially lagged terms cannot
be created. 

The merge() command from the base package allows one to join information
from the two objects, but treats both inputs as standard data.frame objects
and produces a data.frame as the joined output. What I need is a function
that yields a SpatialPolygonsDataFrame object as the output.

Any help would be greatly appreciated.

Thank you in advance,
Yuri 

---
Yuri M. Zhukov
Ph.D. Student
Department of Government
Harvard University
zhukov at fas.harvard.edu



More information about the R-sig-Geo mailing list