R: wrap (pack) a SpatRaster or SpatVector object

wrap {terra} | R Documentation

## wrap (pack) a SpatRaster or SpatVector object

### Description

Wrap a SpatRaster or SpatVector object to create a Packed* object that it can be saved as an R object to disk, or passed over a connection that serializes (e.g. using a computer cluster).

### Usage

    ## S4 method for signature 'SpatRaster'
    wrap(x)

    ## S4 method for signature 'SpatVector'
    wrap(x)

### Arguments

`x` | SpatVector or SpatRaster

### Value

Packed* object

### Examples

    f <- system.file("ex/lux.shp", package="terra")
    v <- vect(f)
    p <- wrap(v)
    p
    vv <- vect(p)
    vv

[Package terra version 1.3-22 Index]