Learn R Programming

raster (version 2.1-41)

shapefile: Read or write a shapefile

Description

Reading and writing "shapefiles". Simple wrapper around readOGR and writeOGR (rgdal package).

Usage

shapefile(filename, object=NULL, overwrite=FALSE, 
                verbose=FALSE, stringsAsFactors=FALSE, ...)

Arguments

filename
Character. Full filename of a shapefile
object
NULL when reading a shapefile. A Spatial* object when writing a shapefile
overwrite
Logical. Overwrite existing shapefile?
verbose
Logical. If TRUE, information about the file is printed
stringsAsFactors
Logical. If TRUE, strings are converted to factors
...
Additional arguments passed to rgdal functions readOGR or writeOGR

Value

  • Spatial*DataFrame (reading). Nothing is returned when writing a shapefile.