Learn R Programming

spsurvey (version 4.0.0)

read.shape: Read Single or Multiple ESRI Shapefiles

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, then 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.

Other Functions Required

readShapeFile

C function to read a single shapefile or multiple shapefiles

SpatialPoints

sp package function to create an object of class SpatialPoints

SpatialPointsDataFrame

function to create an object of class SpatialPointsDataFrame

shape2spList

function to create an object of class Lines for a lines shapefile or class Polygons for a polygons shapefile

SpatialLines

sp package function to create an object of class SpatialLines

SpatialLinesDataFrame

sp package function to create an object of class SpatialLinesDataFrame

SpatialPolygons

sp package function to create an object of class SpatialPolygons

SpatialPolygonsDataFrame

sp package function to create an object of class SpatialPolygonsDataFrame