Learn R Programming

spsurvey (version 4.1.4)

sp2shape: Create an ESRI shapefile from an sp package object

Description

This function creates an ESRI shapefile from an sp package object. The function can also accommodate an object created by the grts or irs functions in spsurvey. The type of shapefile, i.e., point, polyline, or polygon, is determined by the class of the sp object.

Usage

sp2shape(sp.obj, shpfilename)

Arguments

sp.obj

the sp package object or object created by either the grts or irs functions.

shpfilename

Character string containing the name of the shapefile. The shapefile name should include the ".shp" extension. If the name does not include that extension, it will be added.

Value

An ESRI shapefile.