Learn R Programming

terra (version 1.6-17)

wrap: wrap (pack) a SpatRaster or SpatVector object

Description

Wrap a SpatRaster or SpatVector object to create a Packed* object. Packed objects can be saved as an R object to disk (.rds or .RData), or passed over a connection that serializes (e.g. to nodes on a computer cluster); but with large datasets passing a filename could be more sensible in that context.

Usage

# S4 method for SpatRaster
wrap(x)

# S4 method for SpatVector wrap(x)

Value

Packed* object

Arguments

x

SpatVector or SpatRaster

Examples

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

Run the code above in your browser using DataLab