Closed tylerlittlefield closed 4 years ago
As I look at this example, I am a little confused about using parent_vals
in the first layer and then parent_cols
in the second. How do we explain this?
The "Survey" column does not always exist in datasets. So let's say if it does not exist, we will need to manually define the parent value to link the top level nodes to.
In this case tho, the parent can be defined as parent_vals = "OS Students 2014/15"
or parent_col = "Survey"
Oh so the first layer could just use parent_col="Survey"? I prefer that much more because it's consistent, and you can just reference the child_col from the above layer when defining the parent_col in the next layer.
Yup that's the intent! But data doesn't always come in the format we need to so I built in some flexibility :)
This carries the data forward by preserving an attribute
source
which represent the original dataset passed toadd_root()
. I also removed some dplyr functions to avoid depending on dplyr. Also added the pipe as a dependency since we have functions that are designed to use them. Now we can do: