| 1 |
\name{read.asciigrid} |
| 2 |
\alias{read.asciigrid} |
| 3 |
\alias{write.asciigrid} |
| 4 |
\title{ read/write to/from (ESRI) asciigrid format } |
| 5 |
\description{ read/write to/from ESRI asciigrid format } |
| 6 |
\usage{ |
| 7 |
read.asciigrid(fname, as.image = FALSE, plot.image = FALSE, colname = fname, |
| 8 |
proj4string = CRS(as.character(NA))) |
| 9 |
write.asciigrid(x, fname, attr = 1, na.value = -9999, ...) |
| 10 |
} |
| 11 |
|
| 12 |
\arguments{ |
| 13 |
\item{fname}{ file name } |
| 14 |
\item{as.image}{logical; if FALSE, a list is returned, ready to be |
| 15 |
shown with the \code{image} command; if FALSE an object of |
| 16 |
class \link{SpatialGridDataFrame-class} is returned } |
| 17 |
\item{plot.image}{logical; if TRUE, an image of the map is plotted} |
| 18 |
\item{colname}{alternative name for data column if not file name} |
| 19 |
\item{proj4string}{A CRS object setting the projection arguments of the Spatial Grid returned} |
| 20 |
\item{x}{ object of class \link{SpatialGridDataFrame}} |
| 21 |
\item{attr}{attribute column; if missing, the first |
| 22 |
column is taken; a name or a column number may be given} |
| 23 |
\item{na.value}{numeric; value given to missing valued cells in the |
| 24 |
resulting map} |
| 25 |
\item{...}{ arguments passed to \link{write.table}, which is used |
| 26 |
to write the numeric data } |
| 27 |
} |
| 28 |
\value{ |
| 29 |
\code{read.asciigrid} returns the grid map read; either as |
| 30 |
an object of class \link{SpatialGridDataFrame-class} or, if |
| 31 |
as.image is TRUE, as list with components \code{x}, \code{y} and \code{z}. |
| 32 |
} |
| 33 |
\seealso{ \link{as.image.SpatialGridDataFrame}, \link{image} } |
| 34 |
\author{Edzer Pebesma} |
| 35 |
\examples{ |
| 36 |
x <- read.asciigrid(system.file("external/test.ag", package="sp")[1]) |
| 37 |
class(x) |
| 38 |
image(x) |
| 39 |
} |
| 40 |
\keyword{programming} |