A simple assignment in terra
creates a shallow copy, meaning that the original object can be changed if the derived one is edited. The solution if you want to avoid that behaviour is to use deepcopy
. The documentation of deepcopy
shows a similar behaviour for time
as you discovered for extent
: https://rspatial.github.io/terra/reference/deepcopy.html