write.pointShape

0th

Percentile

Write a point-type shapefile

The function calls code from shapelib to write a point-type shapefile.

Keywords
spatial
Usage
write.pointShape(object, file, coordinates, factor2char = TRUE)
Arguments
object
a data frame object
file
a file name of maximum 8 chararacters, numbers or the underscore symbol to be written, omitting the extensions *.shp, *.shx and *.dbf, which are added in the function
coordinates
a 2-column numeric matrix of coordinates
factor2char
logical, default TRUE, convert factor columns to character
Details

The function calls code from shapelib to write a point-type shapefile (both the geometry file with a *.shp extension, the index file with a *.shx extension, and the database file with a *.dbf extension - see write.dbf for details of the data frame export within this function.

Value

  • no return value.

Note

From maptools 0.4-7, this function is placed in the user-visible namespace on a trial basis, and reports of any malfunction should be sent to the package maintainer, Roger Bivand Roger.Bivand@nhh.no. It is likely that this function and its arguments will be changed.

References

http://shapelib.maptools.org/

See Also

write.dbf

Aliases
  • write.pointShape
Examples
balt_orig <- read.shape(system.file("shapes/baltim.shp", package="maptools")[1])
plot(balt_orig)
balt_df <- balt_orig$att.data
balt_cheap <- balt_df[balt_df$PRICE < 40,]
file <- tempfile("")
write.pointShape(balt_cheap, file, coordinates=cbind(balt_cheap$X, balt_cheap$Y))
getinfo.shape(paste(file, ".shp", sep=""))
balt_new <- read.shape(paste(file, ".shp", sep=""))
plot(balt_new, fg="red", glyph=1, add=TRUE)
Documentation reproduced from package maptools, version 0.4-12, License: GPL version 2 or later (R and interface code), MIT (shapelib code)

Community examples

Looks like there are no examples yet.