Learn R Programming

raster (version 1.0.0-1)

extent: Extent

Description

This function returns an Extent object of a Raster* or Spatial* object (or an Extent object), or creates an Extent object from a matrix (2x2; rows=minx, maxx; cols=miny, maxy) or vector (length=4; order= xmin, xmax, ymin, ymax) bbox(x) returns a sp package like 'bbox' object (a matrix)

Usage

extent(x, ...)

Arguments

x
A Raster* or Extent object, a matrix, or four numbers
...
Additional arguments. Only used when x is numeric (to pass three additional numerics)

Value

  • An Extent object

See Also

extent, drawExtent

Examples

Run this code
r <- raster()
extent(r)
extent(c(0, 20, 0, 20))
#is equivalent to
extent(0, 20, 0, 20)
extent(matrix(c(0, 0, 20, 20), nrow=2))

Run the code above in your browser using DataLab