I have a dataframe that has a department, its function, its subfunction and its sub-subfunction. A example of the dataframe would be this: