deepcopy {terra} | R Documentation |
Deep copy
Description
Make a deep copy of a SpatRaster or SpatVector. This is occasionally useful when using an in-place replacement function that does not make copy, such as set.ext
.
Usage
## S4 method for signature 'SpatRaster'
deepcopy(x)
## S4 method for signature 'SpatVector'
deepcopy(x)
Arguments
x |
SpatRaster or SpatVector |
Value
Same as x
Examples
r <- rast(ncols=10, nrows=10, nl=3)
x <- r
y <- deepcopy(r)
ext(r)
set.ext(x, c(0,10,0,10))
ext(x)
ext(r)
ext(y)
[Package terra version 1.8-60 Index]