find_all_children.Rd
The Allen Brain Atlas is organized with a tree structure, where smaller brain areas (e.g. nuclei) are grouped into larger brain areas. Given a particular (child) acronym, this function finds all sub-brain areas, and returns them as a string. This function returns children that are parents themselves, as well their children (i.e., grandchildren (etc.) of the parent structure provided).
find_all_children(atlas, parent)
atlas | Data frame with (at least) two character variables: one for the parents (parent_acronym), and one for the children (acronym). |
---|---|
parent | Acronym of the parent brain area. It must be a character vector of length 1. |
x <- data.frame( parent_acronym = c(rep("main_parent", 3), rep("child_with_children", 2), "grandchild_with_children"), acronym = c("main_parent", "child_with_children", "child_without_children", "grandchild_with_children", "grandchild_without_children", "great_grandchild")) this_parent <- "child_with_children" find_all_children(atlas = x, parent = this_parent)#> Error in atlas %>% dplyr::filter(parent_acronym == parent) %>% dplyr::pull(acronym): could not find function "%>%"