get_ring {h3jsr} | R Documentation |
Get a ring of H3 cell indexes
Description
This function returns all the H3 cell indexes at the specified step from the address supplied.
Usage
get_ring(h3_address = NULL, ring_size = 1, simple = TRUE)
Arguments
h3_address |
Character; 15-character cell index generated by H3. |
ring_size |
Character; number of steps away from the central cell. Defaults to 1. |
simple |
Logical; whether to return a vector of outputs or a data frame containing both inputs and outputs. |
Value
By default, a list of length(h3_address)
. Each list element
contains a character vector of H3 cells belonging to that step away from
the input address.
Note
In total, the number of cells returned for each input index is
ring_size * 6
. This function will throw an error if there is a
pentagon anywhere in the ring.
Examples
# What are the neighbours of this cell at step 2?
get_ring(h3_address = '86be8d12fffffff', ring_size = 2)
[Package h3jsr version 1.3.1 Index]