| mc_save | R Documentation |
movecost result objects contain terra SpatRaster components, which
hold pointers to external memory and therefore cannot be stored with plain
saveRDS()/readRDS(). mc_save() wraps all raster
components (via terra::wrap()) before serialising; mc_load()
restores them. igraph components are serialised natively.
mc_save(x, file)
mc_load(file)
x |
a movecost result object. |
file |
path of the file to write/read (conventionally with extension
|
mc_save() returns file invisibly; mc_load()
returns the restored object.
## Not run:
surf <- mc_surface(mc_volc(), funct = "t", move = 8)
f <- tempfile(fileext = ".rds")
mc_save(surf, f)
surf2 <- mc_load(f)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.