View source: R/write.arcgrid.R
write.arcgrid | R Documentation |
This function writes a 2D matrix into an ESRI ArcInfo gridded ASCII file that can be easily imported into most geographic information systems (GIS)
write.arcgrid(z,file,xlen,ylen,xll,yll,delta,grid,naval=-9999)
z |
2D matrix containing tha data |
file |
name (incuding path, if needed) of the file to write to |
xlen , ylen |
number of data alon x and y axis, resp. |
xll , yll |
position of the lower left (i.e. southwest) corner |
delta |
grid spacing |
grid |
a list containing grid parameters.
Instead of providing xlen,ylen,xll,yll, and delta individually,
containing these values way be provided. For example, such a list is returned
when calling |
naval |
value written to file instead of NA and +/-Inf |
The standard plotting functions for R plot columns along the x axis and
rows along the y axis. Hence the matrix is rotated 90 degrees left (compared to
write.table
or write.csv
) to yield the same
orientation of the data when plotted in R and in GIS.
nothing.
This function was added in version 1.3.0.
Clemens Druee
Wikipedia entry on Esri grid : https://en.wikipedia.org/wiki/Esri_grid
read.dmna
, dmna.grid
# read data and grid info
infile <- system.file("extdata", "example-grid.dmna", package="readmet")
so2 <- read.dmna(infile)
grid <- dmna.grid(infile)
# write file
write.arcgrid(so2, file = "myfile.grid", grid = grid)
# show head of file
writeLines(readLines("myfile.grid", n=7))
# delete file
file.remove("myfile.grid")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.