Hierarchy in groups defined by group_by

Hello,

I am usually in a need to make a calculation in a hierarchical way.

For example assume a data frame with ID columns like X1, X2,X3,X4, . . . , value.

In order to identify unique values i need to filter my df:

X1 is a property defining different experiments let's say then I have X2, as different parameters of the experiment and X3 and X4 different conditions of different experiments below X2 values for example.....

can i use a syntax like ( just applying an abstractr pseudo code below )

x %>% group_by(X1) %>%
         group_by(interaction(X2,X3), add=T ) %>% 
         do

usually what i do to date is I use nested lapply(split(), funcction() {} ) calls to gradually subset. But it could be cool if i can do it in a more compact way with dplyr.

I haven't managed to find anything on the net that's y I'm asking here

Thanks!

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.