R Error: Can't subset columns that don't exist

Hello @Tess ,

the best way to solve this is to provide a reproducible example .
In that way we don't have to create our own test-file to see what is wrong.

But probably you can solve the problem yourself. Start with looking at

DF10 <-  mgs_raw_clean %>%
         header() %>%
         print()

If that looks all right then insert the next line from the pipeline:

DF10 <-  mgs_raw_clean %>%
        group_by_at(c("tree_id","plot_id","block","def_risk","treatment","tree_nr","oak_spec")) %>%
         header() %>%
         print()

Continue doing that until the error occurs.
In that way you find out at which point the error occurs and probably you can handle it yourself.
If not then copy the output of the last step that was working as expected in your next message to the community.