Get (or set) the x and/or y resolution of a Raster* object

xres(x)
yres(x)
res(x)
res(x) <- value

Arguments

x

Raster* object

value

Resolution (single number or vector of two numbers)

Value

A single numeric value or two numeric values.

See also

Examples

r <- raster(ncol=18, nrow=18)
xres(r)
#> [1] 20
yres(r)
#> [1] 10
res(r)
#> [1] 20 10

res(r) <- 1/120
# set yres differently
res(r) <- c(1/120, 1/60)