R/roots.R

Defines functions roots

# Extract the ids of the root(s) of a treedf (=items with no parent)
roots <- function(tree) {
  idx <- which(is.na(tree$parent_id))
  return(tree$id[idx])
}
jiho/checkboxTreeInput documentation built on June 13, 2020, 10:29 a.m.