My code need to group by column names. The problem that the code adds or removes columns to data.frame automatically, thus putting columns names by hand is not good solution. Is there work around this problem. I tried solutions like this but obviously it doesn’t work. In addition the dataframe stretches to over 100 columns.
myDataFrame1 <- myDataFrame %>% group_by( colnames(myDataFrame) )
How can I paste the column names into group_by() automatically.
Thanks for help