In the example below I am trying to convert the df dataframe into the goal_list list. I am having trouble making it match the exact structure and am still new to dealing with lists.
Example
library(tidyverse)
library(data.tree)
df <- dplyr::bind_cols(Manager = c('Robert Baratheon','Robert Baratheon','Robert Baratheon','Robert Baratheon','Robert Baratheon','Robert Baratheon','Robert Baratheon','Eddard Stark','Jory Cassel','Barristan Selmy','Barristan Selmy','Barristan Selmy','Barristan Selmy','Barristan Selmy','Barristan Selmy'),
Employee = c('Eddard Stark', 'Pycelle','Petyr Baelish','Renly Baratheon','Stannis Baratheon','Varys','Barristan Selmy','Jory Cassel','Alyn','Jamie Lannister','Meryn Trant','Mandon Moore','Boros Blount','Preston Greenfield','Arys Oakheart'))
Robert <- Node$new("Robert Baratheon")
Eddard <- Robert$AddChild("Eddard Stark")
Jory <- Eddard$AddChild("Jory Cassel")
Alyn <- Jory$AddChild("Alyn")
Barristan <- Robert$AddChild("Barristan Selmy")
Jamie <- Barristan$AddChild("Jamie Lannister")
Meryn <- Barristan$AddChild("Meryn Trant")
Mandon <- Barristan$AddChild("Mandon Moore")
Boros <- Barristan$AddChild("Boros Blount")
Preston <- Barristan$AddChild("Preston Greenfield")
Arys <- Barristan$AddChild("Arys Oakheart")
Pycelle <- Robert$AddChild("Pycelle")
Petyr <- Robert$AddChild("Petyr Baelish")
Renly <- Robert$AddChild("Renly Baratheon")
Stannis <- Robert$AddChild("Stannis Baratheon")
Varys <- Robert$AddChild("Varys")
goal_list <- ToListSimple(Robert)