Learn R Programming

pgirmess (version 1.3.8)

write.pts2grass: Convert a matrix of points coordinates (x,y) into an ascii GRASS vector file (lines).

Description

Convert a matrix of points coordinates (x,y) into an ascii GRASS vector file (lines).

Usage

write.pts2grass(poly.shp, name)

Arguments

poly.shp
A matrix or data.frame of points coordinates, column 1 = x, column 2 = y
name
The name of the output file (ex: "monfichier.txt"

Value

  • A file is written in the directory specified in filename or in the current working directory.

Details

Write an ascii GRASS vector file (lines) that can be imported from GRASS.

See Also

write.cl2grass

Examples

Run this code
x<-rnorm(30)
y<-rnorm(30)
write.pts2grass(cbind(x,y),"myfile.txt")
# check the new file "myfile.txt"in the working directory

Run the code above in your browser using DataLab