Split dataframe by two columns

I recommend going about it using a tidy approach. See my example here: