Leaving this as an idea so I don't forget about it. There's this R package https://r.igraph.org/ for working with graphs in R. I was already thinking that we could try representing inclusions as directed graphs, e.g.
spain -> european_union -> europe -> world
^
switzerland -----------------/
This can become as complex as we want, as opposed to encoding this information in a dataframe, which would be quite cumbersome. It's nice to know there's a really well maintained R package for working with graphs.
Leaving this as an idea so I don't forget about it. There's this R package https://r.igraph.org/ for working with graphs in R. I was already thinking that we could try representing inclusions as directed graphs, e.g.
This can become as complex as we want, as opposed to encoding this information in a dataframe, which would be quite cumbersome. It's nice to know there's a really well maintained R package for working with graphs.