These functions return or set the extreme coordinates of a Raster* object; and return them for Spatial* objects.

xmin(x)
xmax(x)
ymin(x)
ymax(x)

xmin(x, ...) <- value
xmax(x, ...) <- value
ymin(x, ...) <- value
ymax(x, ...) <- value

Arguments

x

Raster* or Extent object

value

numeric. x or y coordinate

...

additional arguments. None implemented

Value

numeric

See also

extent, dimensions

Examples


r <- raster(xmn=-0.5, xmx = 9.5, ncols=10)
xmin(r)
#> [1] -0.5
xmax(r)
#> [1] 9.5
ymin(r)
#> [1] -90
ymax(r)
#> [1] 90
xmin(r) <- -180
xmax(r) <- 180