Usage
## S3 method for class 'character':
raster(x, band=1, ...)
## S3 method for class 'RasterLayer':
raster(x)
## S3 method for class 'RasterStack':
raster(x, layer=0)
## S3 method for class 'RasterBrick':
raster(x, layer=0)
## S3 method for class 'missing':
raster(nrows=180, ncols=360, xmn=-180, xmx=180, ymn=-90, ymx=90,
crs, ext, resolution, vals=NULL)
## S3 method for class 'Extent':
raster(x, nrows=10, ncols=10, crs=NA, ...)
## S3 method for class 'matrix':
raster(x, xmn=0, xmx=1, ymn=0, ymx=1, crs=NA, template=NULL)
## S3 method for class 'big.matrix':
raster(x, xmn=0, xmx=1, ymn=0, ymx=1, crs=NA, template=NULL)
## S3 method for class 'Spatial':
raster(x, origin, ...)
## S3 method for class 'SpatialGrid':
raster(x, layer=1, values=TRUE)
## S3 method for class 'SpatialPixels':
raster(x, layer=1, values=TRUE)
Arguments
x
filename (character), Extent, Raster*, SpatialPixels*, SpatialGrid*, object, 'image', matrix, im, or missing. Supported file types are the 'native' raster package format and those that can be read via rgdal
(see
band
integer. The layer to use in a multi-layer file
...
Additional arguments, see Details
layer
integer. The layer (variable) to use in a multi-layer file, or the layer to extract from a RasterStack/Brick or SpatialPixelsDataFrame or SpatialGridDataFrame. An empty RasterLayer (no associated values) is returned if layer=0
values
logical. If TRUE
, the cell values of 'x
' are copied to the RasterLayer object that is returned
nrows
integer > 0. Number of rows
ncols
integer > 0. Number of columns
xmn
minimum x coordinate (left border)
xmx
maximum x coordinate (right border)
ymn
minimum y coordinate (bottom border)
ymx
maximum y coordinate (top border)
ext
object of class Extent. If present, the arguments xmn, xmx, ymn and ynx are ignored
crs
character or object of class CRS. PROJ.4 type description of a Coordinate Reference System (map projection). If this argument is missing, and the x coordinates are withing -360 .. 360 and the y coordinates are within -90 .. 90, "+proj=longlat +datum=WGS84
resolution
numeric vector of length 1 or 2 to set the resolution (see res
). If this argument is used, arguments ncols
and nrows
are ignored vals
optional. Values for the new RasterLayer. Accepted formats are as for setValues
origin
minimum y coordinate (bottom border)
template
Raster* or Extent object used to set the extent (and CRS in case of a Raster* object). If not NULL
, arguments xmn
, xmx
, ymn
, ymx
and crs
(unless template
is an Exte