
The {duckspatial} package provides fast and memory-efficient functions to analyze and manipulate large spatial vector datasets in R. It allows R users to benefit directly from the analytical power of DuckDB and its spatial extension, while remaining fully compatible with R’s spatial ecosystem, especially {sf}.
At its core, {duckspatial} bridges two worlds:
This design makes {duckspatial} especially well suited for:
Importantly, {duckspatial} brings the power of DuckDB spatial to R users while keeping workflows similar to {sf} .
You can install duckspatial directly from CRAN with:
install.packages("duckspatial")Or you can install the development version from GitHub with:
# install.packages("pak")
pak::pak("Cidree/duckspatial")A central design principle of {duckspatial} is that the same spatial operation can be used in different ways, depending on how your data is stored and how you want to manage memory and performance.
Most functions in {duckspatial} support four complementary workflows:
sf → Output sfsf → Output DuckDB tablesfSee the “Get Started” vignette for examples.