read_quadtree | R Documentation |
Quadtree
Reads and writes a Quadtree
.
## S4 method for signature 'character'
read_quadtree(x)
## S4 method for signature 'character,Quadtree'
write_quadtree(x, y)
x |
character; the filepath to read from or write to |
y |
a |
To read/write a quadtree object, the C++ library cereal
is used to
serialize the quadtree and save it to a file. The file extension is
unimportant - it can be anything (I've been using the extension '.qtree').
read_quadtree()
- returns a Quadtree
write_quadtree()
- no return value
library(quadtree)
habitat <- terra::rast(system.file("extdata", "habitat.tif", package="quadtree"))
qt <- quadtree(habitat, .1)
path <- tempfile(fileext = "qtree")
write_quadtree(path, qt)
qt2 <- read_quadtree(path)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.