Learn R Programming

pgirmess (version 1.2.8)

write.cl2grass: Convert the output of contourLines into a ascii GRASS vector file (lines).

Description

Convert the output of contourLines into a ascii GRASS vector file (lines).

Usage

write.cl2grass(mescont, filename)

Arguments

mescont
A list obtained from a call to contourLines.
filename
The name of the file to be written (a character string).

Value

  • Files are written in the directory specified in file name or in the current working directory:
  • filename.txtthe ascii GRASS vector file.
  • filenamelev.txta text file with the level of each contour.

Details

Writes two files: a suffix ".txt" is added to filename, the ascii GRASS vector file (to be imported from GRASS); a suffix "lev.txt" is added to filename, a text file with the level of each contour.

See Also

contourLines, write.pts2grass

Examples

Run this code
x<-1:nrow(volcano)
 y<-1:ncol(volcano)
 contour(x, y, volcano)
 mycontours<-contourLines(x, y, volcano)
 write.cl2grass(mycontours, "volcanocont")
 # check the new files "volacnocont.txt" and "volacnocontlev.txt"in the working directory

Run the code above in your browser using DataLab