parent_of_child: parent_of_child

View source: R/parents_of_children.R

parent_of_childR Documentation

parent_of_child

Description

Given a location ID, returns its parent ID at a given level.

Usage

parent_of_child(child_location_id, hierarchy, parent_level)

Arguments

child_location_id

[int] Location ID to pull parent ID for

hierarchy

[data.table] Hierarchy. Must have columns location_id, path_to_top_parent, and level.

parent_level

[int] Single level of the hierarchy - find all parent location_ids of child location_ids at this level

Value

[int] location_id for a single parent of a single child location


epi-sam/SamsElves documentation built on June 12, 2025, 7 a.m.