Learn R Programming

terra (version 0.5-2)

extent: Create, get or set a SpatExtent

Description

Get a SpatExtent of a SpatRaster, or coordinates from such an object. Or create a SpatExtent from a vector (length=4; order= xmin, xmax, ymin, ymax)

Usage

# S4 method for SpatRaster
ext(x, ...)
# S4 method for SpatRaster,SpatExtent
ext(x)<-value

Arguments

x

SpatRaster

value

SpatExtent

...

additional arguments. None implemented

Value

SpatExtent or numeric coordinate

Examples

Run this code
# NOT RUN {
r <- rast()
as.character(r)
as.character(ext(r))
# }

Run the code above in your browser using DataLab