View source: R/children_of_parents.R
children_of_parents | R Documentation |
children_of_parents()
finds children from IHME Hierarchies, given a
vector of location_ids.v From a hierarchy, which children are have a given
parent ID in the path_to_top_parent column? Returns logical T/F vector.
children_of_parents(
parent_loc_ids,
hierarchy,
output = "loc_ids",
include_parent = FALSE
)
parent_loc_ids |
[numeric] vector of parent location_ids |
hierarchy |
[data.table] Which hierarchy to use? (Uses 'path_to_top_parent' to find all nested children) |
output |
[character] Output options:
|
include_parent |
[logical] Do you want parent location_id included with children? (FALSE by default). If FALSE, and using two parent IDs, be careful if the parent location_ids are nested inside each other. |
[logical/numeric] T/F mask for all hierarchy locs, or a vector of children location_ids?
source(file.path("/ihme/cc_resources/libraries/current/r/get_location_metadata.R"))
hierarchy <- get_location_metadata(location_set_id = 111, location_set_version_id = 1050, release_id = 9)
hierarchy$children_of_china <- children_of_parents(6, hierarchy)
hierarchy$china_and_children <- children_of_parents(6, hierarchy, include_parent = TRUE)
child_locs_of_china <- children_of_parents(6, hierarchy, output = "loc_ids")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.