write_quadtree_ptr: Read/write a 'Quadtree'

write_quadtree_ptrR Documentation

Read/write a Quadtree

Description

This is for debugging only, and users should never need to use this function - use write_quadtree() instead. write_quadtree() serializes the CppQuadtree object (note that the underlying C++ object is actually called QuadtreeWrapper, but it is exposed to R as CppQuadtree) stored in the ptr slot of Quadtree.

This function, however, serializes only the Quadtree object contained by the QuadtreeWrapper.

Usage

## S4 method for signature 'character,Quadtree'
write_quadtree_ptr(x, y)

Arguments

x

character; the filepath to read from or write to

y

a Quadtree

Value

no return value

Examples

library(quadtree)
habitat <- terra::rast(system.file("extdata", "habitat.tif", package="quadtree"))

qt <- quadtree(habitat, .1)

path <- tempfile(fileext = "qtree")
write_quadtree_ptr(path, qt)

quadtree documentation built on Aug. 29, 2023, 5:11 p.m.