R code for the analysis in Buzhdygan, O.Y. & Petermann, J.S. (2023) Multitrophic biodiversity enhances ecosystem functions, services and ecological intensification in agriculture. Journal of Plant Ecology, 16:6, rtad019. https://doi.org/10.1093/jpe/rtad019