I am new to R, and need to create hierarchical data format in a shiny application, and hence cannot code it manually. Suppose I have a data frame
parents