Skip to content

duckh3

0.2.0Package record

H3 Extension of 'DuckDB'

0packages depend
2.2Kdownloads / year
5.8%test coverage
10/13flavors OK

Overview

About

Fast & memory-efficient functions to analyze and manipulate large data sets. It leverages the fast analytical capabilities of 'DuckDB' and its spatial extension (see https://duckdb.org/community_extensions/extensions/h3) while maintaining compatibility with R’s spatial data ecosystem to work with spatial vector data.

Changes in 0.2.0

BUILD

  • Requires DuckDB >= 1.5.6
  • Requires duckspatial >= 1.3.0

ENHANCEMENTS

  • Functions in vetorized mode automatically parse to UBIGINT when the input is a numeric vector.
  • Error message on wrong CRS is now displayed correctly (#3).

NEW FEATURES

  • New functions to convert polygon and linestring geometries to H3 cells (#2):
  • ddbh3_polygons_to_h3() / ddbh3_lines_to_h3() add a list column with the H3 cells intersecting each feature (string or UBIGINT).
  • ddbh3_polygons_to_spatial() / ddbh3_lines_to_spatial() return one row per intersecting cell, with geometry replaced by the cell hexagon boundary.
Show all changes in 0.2.0Hide the rest of the changes in 0.2.0
  • Polygons use DuckDB's experimental polygon polyfill (overlap containment by default); lines are polyfilled via a buffer-then-exact-trim strategy since they have no native polyfill (buffer_scale argument).

From NEWS.md in the release

Install

Health

CRAN checks
3ERROR10OK
Check messages
ERRORexamplesr-devel-linux-x86_64-fedora-clang, r-oldrel-macos-x86_64, r-release-macos-x86_64

r-oldrel-macos-x86_64, r-release-macos-x86_64

Running examples in ‘duckh3-Ex.R’ failed
The error most likely occurred in:

> ### Name: ddbh3_get_child_pos
> ### Title: Get the position of an H3 cell within its parent
> ### Aliases: ddbh3_get_child_pos
> 
> ### ** Examples
> 
> ## Load needed packages
> library(duckh3)
> library(dplyr)

Attaching package: ‘dplyr’

The following objects are masked from ‘package:stats’:

    filter, lag

The following objects are masked from ‘package:base’:

    intersect, setdiff, setequal, union

> 
> ## Setup the default connection with h3 and spatial extensions
> ## This is a mandatory step to use duckh3 functions
> ddbh3_default_conn(threads = 1)
duckdb is storing downloaded extensions and secrets under ~/.duckdb:
ℹ /Users/urbanek/.duckdb
This persists across sessions and is shared with the DuckDB CLI and other clients.
ℹ Run duckdb(shared_home = FALSE) to use a temporary directory instead.
ℹ See ?duckdb_storage for details and alternatives.
Error in `value[[3L]]()`:
! Failed to load the h3 exte
...[truncated]...
ble architecture (have 'arm64', need
  'x86_64h' or 'x86_64')),
  '/System/Volumes/Preboot/Cryptexes/OS/Users/urbanek/.duckdb/extensions/v1.5.6/osx_amd64/h3.duckdb_extension'
  (no such file),
  '/Users/urbanek/.duckdb/extensions/v1.5.6/osx_amd64/h3.duckdb_extension'
  (mach-o file, but is an incompatible architecture (have 'arm64', need
  'x86_64h' or 'x86_64')) ℹ Context: rapi_execute ℹ Error type: IO
ℹ The binary may be corrupt or incompatible with this platform/DuckDB version.
ℹ Try reinstalling with `ddbs_install(extension = 'h3', upgrade = TRUE)`
Backtrace:
    ▆
 1. └─duckh3::ddbh3_default_conn(threads = 1)
 2.   └─duckspatial::ddbs_load(conn, quiet = TRUE, extension = "h3")
 3.     └─base::tryCatch(...)
 4.       └─base (local) tryCatchList(expr, classes, parentenv, handlers)
 5.         └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
 6.           └─value[[3L]](cond)
 7.             └─cli::cli_abort(...)
 8.               └─rlang::abort(...)
Execution halted

r-devel-linux-x86_64-fedora-clang

Running examples in ‘duckh3-Ex.R’ failed
The error most likely occurred in:

> ### Name: ddbh3_get_child_pos
> ### Title: Get the position of an H3 cell within its parent
> ### Aliases: ddbh3_get_child_pos
> 
> ### ** Examples
> 
> ## Load needed packages
> library(duckh3)
> library(dplyr)

Attaching package: ‘dplyr’

The following objects are masked from ‘package:stats’:

    filter, lag

The following objects are masked from ‘package:base’:

    intersect, setdiff, setequal, union

> 
> ## Setup the default connection with h3 and spatial extensions
> ## This is a mandatory step to use duckh3 functions
> ddbh3_default_conn(threads = 1)
duckdb is storing downloaded extensions and secrets under ~/.duckdb:
ℹ /data/localhost/ripley/.duckdb
This persists across sessions and is shared with the DuckDB CLI and other clients.
ℹ Run duckdb(shared_home = FALSE) to use a temporary directory instead.
ℹ See ?duckdb_storage for details and alternatives.
duckdb was built with libc++ (not libstdc++) o
...[truncated]...
! Failed to load the spatial extension.
✖ DuckDB extension loading (INSTALL / LOAD) is disabled for this driver. ℹ
  Recreate the driver with duckdb(allow_extensions = TRUE) to enable it (this
  may crash R on a Linux build not compiled with libstdc++; see
  https://github.com/duckdb/duckdb-r/issues/1107). ℹ See ?duckdb for details. ℹ
  Context: load_extension
ℹ The binary may be corrupt or incompatible with this platform/DuckDB version.
ℹ Try reinstalling with `ddbs_install(extension = 'spatial', upgrade = TRUE)`
Backtrace:
    ▆
 1. └─duckh3::ddbh3_default_conn(threads = 1)
 2.   └─duckspatial::ddbs_create_conn(...)
 3.     └─duckspatial::ddbs_load(conn, quiet = TRUE)
 4.       └─base::tryCatch(...)
 5.         └─base (local) tryCatchList(expr, classes, parentenv, handlers)
 6.           └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
 7.             └─value[[3L]](cond)
 8.               └─cli::cli_abort(...)
 9.                 └─rlang::abort(...)
Execution halted
ERRORtestsr-devel-linux-x86_64-fedora-clang, r-oldrel-macos-x86_64, r-release-macos-x86_64

r-oldrel-macos-x86_64, r-release-macos-x86_64

Running ‘testthat.R’ [2s/3s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > # This file is part of the standard setup for testthat.
  > # It is recommended that you do not modify it.
  > #
  > # Where should you do additional test configuration?
  > # Learn more about the roles of various files in:
  > # * https://r-pkgs.org/testing-design.html#sec-tests-files-overview
  > # * https://testthat.r-lib.org/articles/special-files.html
  > 
  > library(testthat)
  > library(duckh3)
  > 
  > test_check("duckh3")
  duckdb is storing downloaded extensions and secrets under ~/.duckdb:
  ℹ /Users/urbanek/.duckdb
  This persists across sessions and is shared with the DuckDB CLI and other clients.
  ℹ Run duckdb(shared_home = FALSE) to use a temporary directory instead.
  ℹ See ?duckdb_storage for details and alternatives.
  Error in `source_dir()`:
  ! Failed to evaluate './setup.R'.
  Caused by error in `value[[3L]]()`:
  ! Failed to load the h3 extension.
  ✖ IO Error: Ext
...[truncated]...
R]$", env = env, wrap = FALSE)
    8.               └─base::lapply(...)
    9.                 └─testthat (local) FUN(X[[i]], ...)
   10.                   └─testthat::source_file(...)
   11.                     ├─base::withCallingHandlers(...)
   12.                     └─base::eval(exprs, env)
   13.                       └─base::eval(exprs, env)
   14.                         └─duckh3::ddbh3_default_conn() at ./setup.R:12:1
   15.                           └─duckspatial::ddbs_load(conn, quiet = TRUE, extension = "h3")
   16.                             └─base::tryCatch(...)
   17.                               └─base (local) tryCatchList(expr, classes, parentenv, handlers)
   18.                                 └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
   19.                                   └─value[[3L]](cond)
   20.                                     └─cli::cli_abort(...)
   21.                                       └─rlang::abort(...)
  Execution halted

r-devel-linux-x86_64-fedora-clang

Running ‘testthat.R’
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > # This file is part of the standard setup for testthat.
  > # It is recommended that you do not modify it.
  > #
  > # Where should you do additional test configuration?
  > # Learn more about the roles of various files in:
  > # * https://r-pkgs.org/testing-design.html#sec-tests-files-overview
  > # * https://testthat.r-lib.org/articles/special-files.html
  > 
  > library(testthat)
  > library(duckh3)
  > 
  > test_check("duckh3")
  duckdb is storing downloaded extensions and secrets under ~/.duckdb:
  ℹ /data/localhost/ripley/.duckdb
  This persists across sessions and is shared with the DuckDB CLI and other clients.
  ℹ Run duckdb(shared_home = FALSE) to use a temporary directory instead.
  ℹ See ?duckdb_storage for details and alternatives.
  duckdb was built with libc++ (not libstdc++) on Linux, so DuckDB extensions are disabled:
  • Loading a prebuilt (libstdc++) extension could crash R (htt
...[truncated]...
(...)
    9.                 └─testthat (local) FUN(X[[i]], ...)
   10.                   └─testthat::source_file(...)
   11.                     ├─base::withCallingHandlers(...)
   12.                     └─base::eval(exprs, env)
   13.                       └─base::eval(exprs, env)
   14.                         └─duckh3::ddbh3_default_conn() at ./setup.R:12:1
   15.                           └─duckspatial::ddbs_create_conn(...)
   16.                             └─duckspatial::ddbs_load(conn, quiet = TRUE)
   17.                               └─base::tryCatch(...)
   18.                                 └─base (local) tryCatchList(expr, classes, parentenv, handlers)
   19.                                   └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
   20.                                     └─value[[3L]](cond)
   21.                                       └─cli::cli_abort(...)
   22.                                         └─rlang::abort(...)
  Execution halted

CRAN check page ↗

Slowest check: 1.2 min · r-oldrel-windows-x86_64
Status changes
  • ERROR10 OK, 3 ERRORNow
  • ERROR10 OK, 1 ERROR2026-04-28
  • OK5 OK2026-04-25
Advisories

none known

Documentation

In release 0.2.0
READMEYes · 438 wordsVignettesNoNEWSYes · 100% structured · mentions 0.2.0Citation fileNoWebsiteYes · pkgdown
Help pages
12
Examples that run
67%8 run in a plain check · 3 only when donttest examples are enabled (R CMD check --as-cran) · 1 hold no code
Exported functions with examples
100%
Documented parameters
100%
Return-value docs
100%
Help pages citing references
0%

Downloads

2.2K
CRAN downloads in the past year
Rank #13,091 · ~6/day · ~183/mo
Daily download trend is not available in this view yet.
34630 days
87290 days
2.2K1 year
Compare downloads with other packages →
Also on59 r2u

Repository

14Stars
0Forks
2Open issues
6Open PRs
2Releases
57Commits
1Commit identities
License file reads as GPL-3.0 · 57 commits · Last activity 2026-10-17 · 0% stars, 30d · Default branch at 0.2.0.9000, ahead of CRAN 0.2.0 (checked 2026-10-21)
Responsiveness
How these are sampled
PRs merged (all time)
100%
Median days to close, 50 most recently updated closed issues
34
Median days to close, 50 most recently updated closed PRs
0

Stars over time

2026-03-07 · 12026-07-07 · 14
PracticesBeta

10 development-tooling and community-health practices detected across 6 families in the upstream repository

Checks run against github.com/cidree/duckh3 on 2026-10-21.

Continuous integration (2)
GitHub ActionsR CMD check workflow

The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel

Governance and community (1)
Funding

Funding links: buymeacoffee.com

Docs source (4)
README.Rmdpkgdown

GitHub Pages site last deployed 2026-10-17 · The repository has a site deploy workflow

pkgdown site last built 2026-10-17

Coverage (1)
Coverage reporting
Show all practicesHide 2 practices
CRAN release process (1)
cran-comments.md
Lint, format, editor (1)
RStudio project
How this is detected·Detection ruleset v4 (2026-10-20)
AI coding toolsBeta

This repository shows signs of AI coding tools.

  • Claude Codefirst seen 2026-10-19
    Pull request it wrote: opened by a project member
How this is detected·Detection ruleset v4 (updated 2026-09-27)

Dependencies

Declared dependencies
10 external dependencies (excludes base and recommended)

Installing duckh3 adds 41 packages (28 with compiled code, 54 MB of source tarballs). Heaviest: stringi 11 MB, sf 9.3 MB, duckdb 7.9 MB.

Depends (1)
R >= 4.1.0
LinkingTo (0)
none
Suggests (2)
Enhances (0)
none
Reverse dependencies
0direct
0indirect

Nothing depends on this yet.

Datasets

People & History

People (3)
Author, Maintainer since 0.1.0 (2026)
Author
Releases (2)

Pick two releases to compare their code metrics.

  • 0.2.0Latest
    record
    2026-10-11 · current release · diff ↗ ·
    added 4 exports
    ddbh3_lines_to_h3, ddbh3_lines_to_spatial, ddbh3_polygons_to_h3, ddbh3_polygons_to_spatial
  • 0.1.0
    record
    2026-04-24
  • R
    R 4.6.0 released · 2026-04-24
  • R
    R 4.5.0 released · 2025-04-11

Package metadata

First published
2026-04-24
Total releases
2 / 1 yrs
License
GPL (>= 3) OSI
Minimum R
≥ 4.1.0
Download size
1.6 MB

Cite

Cite this package

Run in R for the authors' preferred citation:

citation("duckh3")
Cidre González, A., Kotov, E., & Pereira, R. H. M. (2026). duckh3: H3 Extension of 'DuckDB' (Version 0.2.0) [Computer software]. https://doi.org/10.32614/CRAN.package.duckh3

This package has no citation file, so citation() returns this entry built from DESCRIPTION.

Cite the R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for duckh3 version 0.2.0 [Data set]. HJJB, LLC. Data release v2026-10-23. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-23, which the citation names so these numbers can be found later. More on citing and the projects behind them.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy