origin.Rd
Origin returns (or sets) the coordinates of the point of origin of a Raster* object. This is the point closest to (0, 0) that you could get if you moved towards that point in steps of the x and y resolution.
origin(x, ...)
origin(x) <- value
A vector of two numbers (x and y coordinates), or a changed origin for x
.
r <- raster(xmn=-0.5, xmx = 9.5, ncols=10)
origin(r)
#> [1] 0.5 0.0
r
#> class : RasterLayer
#> dimensions : 180, 10, 1800 (nrow, ncol, ncell)
#> resolution : 1, 1 (x, y)
#> extent : -0.5, 9.5, -90, 90 (xmin, xmax, ymin, ymax)
#> crs : +proj=longlat +datum=WGS84 +no_defs
#>
origin(r) <- 0
r
#> class : RasterLayer
#> dimensions : 180, 10, 1800 (nrow, ncol, ncell)
#> resolution : 1, 1 (x, y)
#> extent : 0, 10, -90, 90 (xmin, xmax, ymin, ymax)
#> crs : +proj=longlat +datum=WGS84 +no_defs
#>