Skip to contents

Provides the parent (coarser) index containing cell

Usage

cellToParent(cell, parentRes)

Arguments

cell

vector of H3 cells

parentRes

integer vector specifying the parent resolution for each cell

Value

vector of parent cells for each cell

Examples


cell <- "8cbe63562a54bff"
getResolution(cell = cell)
#> [1] 12

## The `parentRes` should be a lower value than the result of  `getResolution()`
cellToParent(cell = rep(cell, 2), parentRes = c(11L, 10L))
#> [1] "8bbe63562a54fff" "8abe63562a57fff"

## Specifying a single resolution
cells <- c("8cbe63562a54bff", "8cbe635631103ff")
getResolution(cell = cells)
#> [1] 12 12

cellToParent(cell = cells, parentRes = 6)
#> [1] "86be63567ffffff" "86be63567ffffff"
cellToParent(cell = cells, parentRes = 7)
#> [1] "87be63562ffffff" "87be63563ffffff"