a5_grid_disk: Cells within k hops of a cell

View source: R/traversal.R

a5_grid_diskR Documentation

Cells within k hops of a cell

Description

Returns all cells reachable within k edge hops of a centre cell, including the centre cell itself.

Usage

a5_grid_disk(cell, k, vertex = FALSE)

Arguments

cell

A single a5_cell value.

k

Integer scalar, number of hops.

vertex

Logical scalar. If FALSE (default), only edge-sharing neighbours (4-connected) are traversed. If TRUE, vertex-sharing neighbours are included (8-connected).

Value

A compacted a5_cell vector.

See Also

a5_spherical_cap() for distance-based selection.

Examples

cell <- a5_lonlat_to_cell(-3.19, 55.95, resolution = 8)
a5_grid_disk(cell, k = 1)

a5R documentation built on March 26, 2026, 5:10 p.m.