Learn R Programming

raster (version 3.6-30)

resolution: Resolution

Description

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

Usage

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

Value

A single numeric value or two numeric values.

Arguments

x

Raster* object

value

Resolution (single number or vector of two numbers)

See Also

Examples

Run this code
r <- raster(ncol=18, nrow=18)
xres(r)
yres(r)
res(r)

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


Run the code above in your browser using DataLab