Learn R Programming

spsurvey (version 3.1)

read.shape: Read an ESRI Shapefile

Description

This function reads either a single shapefile or multiple shapefiles. For multiple shapefiles, all of the shapefiles must be the same type, i.e., point, polyline, or polygon.

Usage

read.shape(filename=NULL)

Arguments

filename
name of the shapefile without any extension. If filename equals a shapefile name, than that shapefile is read. If filename equals NULL, then all of the shapefiles in the working directory are read. The default is NULL.

Value

An sp package object containing information in the shapefile. The object is assigned class "SpatialPointsDataFrame", "SpatialLinesDataFrame", or "SpatialPolygonsDataFrame" corresponding to the shapefile type, i.e., point, polyline, or polygon, respectively. For further information regarding the output object, see documentation for the sp package.

References

ESRI Shapefile Technical Description: http://www.esri.com/library/whitepapers/pdfs/shapefile.pdf

See Also

read.dbf

Examples

Run this code
  ## Not run: 
#   read.shape("my.shapefile")
#   ## End(Not run)

Run the code above in your browser using DataLab