Skip to content

How to write R dataframe to shapefile

1 message · Dan Putler

#
Hi Mark,

The easy way is a two step process, using the sp and rgdal packages.
Create a SpatialPointsDataFrame using the SpatialPointsDataFrame
function in sp, and then write it out using the writeOGR function in
rgdal. You can get things correct coordinate system by using
CRS("+init=epsg:4979") for the proj4string argument to
SpatialPointsDataFrame, although there are a number of other EPSG codes
that corresponds to WGS84 geographic coordinates.

Dan
On Sun, 2009-12-20 at 11:21 -0600, Mark Na wrote: