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