Hi HanOostdijk,
I didn't know about the reproducible example. Thanks for the hint. I hope you can work with the one down below. So as I can now see, the problem probably is that R can not open the file BRC19-galls-tree.csv . How can I solve this though? I was sure that the first code "mgs_raw_clean <- read.csv .... " is the one for loading the data.
mgs_raw_clean <- read.csv("./Data/BRC19-galls-tree.csv", header = TRUE, sep = ";")
#> Warning in file(file, "rt"): can not open file './Data/BRC19-galls-tree.csv'
#> No such file or directory
#> Error in file(file, "rt"): can not open connection
DF10 <- mgs_raw_clean %>%
group_by_at(c("tree_id","plot_id","block","def_risk","treatment","tree_nr","oak_spec")) %>%
summarise(gall_pa = sum(gall_abund != 0),
agamous = sum(agamous), sexual = sum(sexual), single = sum(single), unknown = sum(unknown),
gall_abund = sum(gall_abund), .groups = "drop") %>%
mutate(total_galls = agamous + sexual + single + unknown + gall_abund) %>%
dplyr::select(c(tree_id, plot_id, block, def_risk, treatment, tree_nr, oak_spec,
n_leaves, mildew_cov, gall_pa, gall_abund, everything()))
#> Error in mgs_raw_clean %>% group_by_at(c("tree_id", "plot_id", "block", : can not find function "%>%"