Data and code from: Food resources are more important than nesting resources for explaining wild bee diversity in urban gardens
Data files
Aug 21, 2026 version files 80.20 KB
-
README.md
19.76 KB
-
WildBeeTraitsProject.zip
60.44 KB
Abstract
Wild bees are declining worldwide, with urbanisation as one major driver. Urban environments can filter for wild bees with specific functional traits and resource requirements. Nevertheless, cities can support many wild bee species, especially in urban gardens. Yet, we do not know how specific habitat features influence bee species persistence and community composition in gardens, which prevents implementing appropriate conservation measures.
We investigated how local and landscape garden features affect the taxonomic and functional diversity of wild bees and their community composition, and which garden features associate with wild bee functional guilds in urban community gardens.
Over two years, we surveyed community gardens in Munich and Berlin (Germany), assessed bees using flower observations and pan traps, and measured local and landscape garden features (food and nesting resources, habitat availability incl. urbanisation).
We found 168 wild bee species, ~1/3 of Germany's bee species. Floral richness was the main driver of bee taxonomic and functional diversity. Urbanisation, floral resources and open ground within gardens significantly affected bee community composition. Finally, we found associations between garden features and bee functional guilds. For example, the abundance of parasitic bees increased with floral richness, that of ground nesters with open ground and that of late-emerging species with urbanisation.
Urban gardens are important wild bee habitats in cities and spaces for conservation action. Diversifying available resources may support high bee diversity, and considering species functional traits and species requirements may further improve urban gardens and other urban ecosystems as bee habitats.
title: "README"
date: "2026-08-21"
doi: https://doi.org/10.5061/dryad.66t1g1kcz
General information
The following repository includes all necessary information on data and code to replicate the analysis for the manuscript: "Food resources are more important than nesting resources for explaining wild bee diversity in urban gardens".
The repository Dryad provides the R code structure, data and code. The data for the variable of wild bee mean intertegular distance (ITD) will only be published here after the publication of the European Bee Traits Database by S. Roberts et al. in the future.
The variables “deadwood_x_y”, “garden_area” and “impervious_1000” have been published before on Zenodo under a CC BY 4.0 licence in association with the publication of Neumann et al. (2024). These variables therefore need to be downloaded separately from the rest of the data and then correctly merged with the datasets provided on survey level ("Wildbees_features_survey_subset.csv") and garden/year level ("Wildbees_features_garden_year_subset.csv"). A step-by-step instruction on how to merge these variables with the datasets is provided below the dataset description in this README file.
Corresponding author information
Name: Astrid E. Neumann
Orcid: 0000-0002-1736-3946
Affiliation: Urban Productive Ecosystems, Technical University of Munich, Freising, Germany
email: astrid.neumann@tum.de
Alternative contact information
Name: Monika Egerer
Orcid: 0000-0002-3304-0725
Affiliation: Urban Productive Ecosystems, Technical University of Munich, Freising, Germany
email: monika.egerer@tum.de
Associated publication
Neumann, A.E.; Casanelles-Abella, J.; Conitz, F.; Karlebowski, S.; Roberts, S.; Schmack, J.M.; Sturm, U.; Sexton, A.N.; Egerer, M. Food resources are more important than nesting resources for explaining wild bee diversity in urban gardens
Description of the data and file structure
Project structure
The compressed file "WildBeeTraitsProject.zip" contains three main directories, that is, "Input", "Scripts" and "Output". Load the data and produce the output:
WildBeeTraitsProject
├── Input
│ ├── Wildbees_features_garden_year_subset.csv
│ ├── Wildbees_features_survey_subset.csv
│ ├── Wildbees_traits_taxonomy_excl_ITD.csv
├── Scripts
│ ├── 01_GLMM
│ ├── 02_RLQ
│ ├── 03_NMDS_garden_level
│ ├── 03_NMDS_survey_level
│ ├── 04_Figures_NMDS_garden_level
│ ├── 04_Figures_NMDS_survey_level
│ ├── 04_Figures_GLMM
│ ├── 04_Figures_traits_overview
│ ├── 04_Figures_species_overview
│ ├── 05_INEXT
├── Output
│ ├── figure_1
│ ├── figure_2
│ ├── figure_3
│ ├── figure_4 (a-f)
│ ├── figure_5
│ ├── figure_s3
│ ├── figure_s4 (a, b)
│ ├── figure_s5 (a-f)
- Directory "Scripts" contains the R scripts. They are described in the section "Scripts" below in this README
- Directory "Input" contains three datasets on (1) wild bee traits, (2) wild bee diversity and garden features on a survey level and (3) a garden/year level
- Directory "Output" is empty and will be filled when running the scripts
Provided data in this repository
Wild bee diversity and garden features on a garden/year level
Filename: Wildbees_features_garden_year_subset.csv
Format: Semicolon-delimited CSV file
Location: This dataset is found under the following path: WildBeeTraitsProject/Input/
Description: The following dataset contains the bee species and abundances, wild bee taxonomic and functional diversity metrics and local and landscape garden features per garden and year. The dataset is a CSV file and is structured as described below:
- garden_year_ID: ID for garden per year level ("gardencode_year")
- garden_code: Garden abbreviation for analysis
- year: Year of data sampling
- city: City of data sampling
- Andrena_alfkenella - Xylocopa_violacea: Wild bee species abundance based on four rounds per year of flower observations plus netting and pan trap sampling
- open_ground: The estimated percentage of bare soil within the 400 m² sampling plots within each garden (study sites). Two values per garden (one each year). 2021: round 4, 2022: round 2 (based on number of observers and their experience)
- beehotels_x_y: The number of artificial insect nesting aids (bee hotels) within the 400 m² sampling plots (x) and within a 10 m buffer surrounding the plots (y). Two values per garden (one each year). 2021: round 4, 2022: round 2 (based on number of observers and their experience)
- stones: The number of stone structures (sum of the "rock_structures_x_y", counting rock structures, and "drywall_x_y", counting dry stone walls) within the 400 m² sampling plots (x) and within a 10 m buffer surrounding the plots (y). Two values per garden (one each year). 2021: round 4, 2022: round 2 (based on number of observers and their experience)
- Asteraceae_prop_ga_yr: Proportion of Asteraceae in the garden (using average cover of all four rounds of all 8 1x1 m plots)
- Lamiaceae_prop_ga_yr: Proportion of Lamiaceae in the garden (using average cover of all four rounds of all 8 1x1 m plots)
- Fabaceae_prop_ga_yr: Proportion of Asteraceae in the garden (using average cover of all four rounds of all 8 1x1 m plots)
- flow_rich_ga_yr: Number/Richness of flowering plant species per garden and year (using sum of all four rounds of all 8 1x1 m plots; calculated using vegan)
- tree_rich_ga_yr: Number/richness of tree species calculated using vegan per garden and year (sum of all four rounds per year)
- bee_rich_ga_yr: Number/richness of wild bee species calculated using vegan per garden and year (sum of all four rounds per year)
- shannon_ga_yr: Shannon diversity index of wild bees calculated using vegan per garden and year (using "bee_rich_ga_yr" and "bee_abund_ga_yr")
- bee_abund_ga_yr: Number/abundance of wild bee individuals calculated using vegan per garden and year (sum of all four rounds per year)
- bee_even_ga_yr: Evenness of wild bees, calculated using vegan per garden and year
- fdis: Wild bee functional dispersion calculated using mFD
- feve: Wild bee functional evenness calculated using mFD
- fric: Wild bee functional richness calculated using mFD
The following variables are NOT included in this subset dataset, because they have been published before under a CC BY 4.0 Licence on Zenodo (https://doi.org/10.5281/zenodo.10961505) in association with the publication of Neumann et al. (2024):
deadwood_x_y: The number of deadwood pieces within the 400 m² sampling plots (x) and within a 10 m buffer surrounding the plots (y). Two values per garden (one each year). 2021: round 4, 2022: round 2 (based on number of observers and their experience)
garden_area: Garden size in m² (one value per year)
impervious_1000: Percentage of impervious surfaces around the garden within a 1000 m radius
Download and merge missing variables:
To follow the provided analyses, these three variables have to be added to "Wildbees_features_garden_year_subset.csv". Follow the following steps to create the full dataset "Wildbees_features_garden_year.csv", which can be used for the analyses:
- Download the dataset “Garden features, diversity and abundance of pollinators in urban community gardens” with the file name “DATA_pollinators_garden_features_11-04-2024” from Zenodo (https://doi.org/10.5281/zenodo.10961505)
- Extract the variables “deadwood”, “garden_area”, “impervious_1000”, and for creating the identifier for merging the data “garden_code” and “year”.
- Summarize the dataset to a garden/year level. The new variables should consist of the following data:
- “deadwood”: For 2021, only use data from round 4 and for 2022 only use data from round 2
- “garden_area”: One value should exist per garden and year.
- “impervious_1000”: One value should exist per garden and year.
- Create an identifier named “garden_year_ID” from “garden_code” and “year” in the format “garden_code”_”year”, e.g. AKT_2021
- Rename the variable “deadwood” to “deadwood_x_y”.
- Download the dataset provided here: WildBeeTraitsProject/Input/Wildbees_features_garden_year_subset.csv
- Merge the variables “garden_area”, “impervious_1000” and “deadwood_x_y” with the dataset for garden/year level from the input folder “Wildbees_features_garden_year_subset” using “garden_year_ID” as identifier.
- Save the new dataset WildBeeTraitsProject/Input/ and name it “Wildbees_features_garden_year.csv”.
Wild bee diversity and garden features on a survey level
Filename: Wildbees_features_survey_subset.csv
Format: Semicolon-delimited CSV file
Location: This dataset is found under the following path: WildBeeTraitsProject/Input/
Description: The following dataset contains the bee species and abundances, wild bee taxonomic and functional diversity metrics and local and landscape garden features per survey and garden. The dataset in a CSV file and is structured as described below:
- garden_code: Garden abbreviation for analysis
- city: City of data sampling
- round: Number of garden visit/sampling round per year
- year: Year of data sampling
- survey_ID: ID for each survey per garden, round and year ("gardencode_round_year")
- Andrena_alfkenella - Xylocopa_violacea: Wild bee species abundance per round (flower observations plus netting and pan trap sampling)
- bee_rich_surv: Number/richness of wild bee species calculated using vegan per survey
- bee_shannon_surv: Shannon diversity index of wild bees calculated using vegan per survey (using "bee_rich_surv" and "bee_abund_surv")
- bee_abund_surv: Number/abundance of wild bee individuals calculated using vegan per survey
- month: Month of garden visit/sampling
- garden: Garden name
- open_ground: The estimated percentage of bare soil within the 400 m² sampling plots within each garden (study sites). Two values per garden (one each year). 2021: round 4, 2022: round 2 (based on number of observers and their experience)
- beehotels_x_y: The number of artificial insect nesting aids (bee hotels) within the 400 m² sampling plots (x) and within a 10 m buffer surrounding the plots (y). Two values per garden (one each year). 2021: round 4, 2022: round 2 (based on number of observers and their experience)
- stones: The number of stone structures (sum of "rock_structures_x_y", counting rock structures, and "drywall_x_y", counting dry stone walls) within the 400 m² sampling plots (x) and within a 10 m buffer surrounding the plots (y). Two values per garden (one each year). 2021: round 4, 2022: round 2 (based on number of observers and their experience)
- garden_year_ID: ID for garden per year level ("gardencode_year")
- fdis: Wild bee functional dispersion calculated using mFD per garden and year
- feve: Wild bee functional evenness calculated using mFD per garden and year
- fric: Wild bee functional richness calculated using mFD per garden and year
- tree_flow_rich_surv: Number/richness of flowering tree species calculated using vegan per survey
- flow_rich_survey: Number/Richness of flowering plant species per survey (using sum of all 8 1x1 m plots; calculated using vegan)
- Asteraceae_prop_survey: Proportion of Asteraceae in the garden per survey (using average cover of all 8 1x1 m plots)
- Lamiaceae_prop_survey: Proportion of Lamiaceae in the garden per survey (using average cover of all 8 1x1 m plots)
- Fabaceae_prop_survey: Proportion of Asteraceae in the garden per survey (using average cover of all 8 1x1 m plots)
- bee_even_surv: Evenness of wild bees, calculated using vegan per survey and garden
The following variables are NOT included in this subset dataset, because they have been published before under a CC BY 4.0 Licence on zenodo (https://doi.org/10.5281/zenodo.10961505):
deadwood_x_y: The number of deadwood pieces within the 400 m² sampling plots (x) and within a 10 m buffer surrounding the plots (y). Two values per garden (one each year). 2021: round 4, 2022: round 2 (based on number of observers and their experience)
garden_area: Garden size in m² (one value per year)
impervious_1000: Percentage of impervious surfaces around the garden within a 1000 m radius (one value per year)
Download and merge missing variables:
To follow the provided analyses, these three variables have to be added to "Wildbees_features_survey_subset.csv". Follow the following steps to create the full dataset "Wildbees_features_survey.csv", which can be used for the analyses:
- Download the dataset “Garden features, diversity and abundance of pollinators in urban community gardens” with the file name “DATA_pollinators_garden_features_11-04-2024” from Zenodo (https://doi.org/10.5281/zenodo.10961505)
- Extract the variables “deadwood”, “garden_area”, “impervious_1000”, “round” and “ID” as identifiers for merging the data.
- Rename the following variables:
“ID” -> “survey_ID” - Download the dataset provided here: WildBeeTraitsProject/Input/Wildbees_features_survey_subset.csv
- Merge the variables “garden_area” and “impervious_1000” as they are from “DATA_pollinators_garden_features_11-04-2024” with the dataset for survey level in the input folder “Wildbees_features_survey_subset” using “survey_ID” as identifyer.
- Create the new variable “deadwood_x_y” in “Wildbees_features_survey_subset”, which is later used in the analysis.
- Select from the variable “deadwood” for each garden the values from round 4 in 2021. Paste these values into the new variable “deadwood_x_y” for all rounds in 2021. All gardens in the new variable “deadwood_x_y” should have the same values for each round per garden in 2021. Repeat the same for round 2 in 2022. The aim is to have the same value for deadwood per garden and year, using round 4 in 2021 and round 2 in 2022.
- Delete the former variable “deadwood”.
- Save the new dataset in WildBeeTraitsProject/Input/ and name it “Wildbees_features_survey.csv”.
Wild bee trait data
Filename: Wildbees_traits_taxonomy_excl_ITD.csv
Format: Semicolon-delimited CSV file
Location: This dataset is found under the following path: WildBeeTraitsProject/Input/
Description: The following dataset contains all wild bee species that we sampled using flower visitor observations and pan traps and corresponding trait data. Trait data derived from: Westrich (2018), Scheuchl & Willner (2016), Amiet et al. (2001), Amiet et al. (2005), Amiet et al. (2017), Amiet & Krebs (2019), Weissmann & Schaefer (2022), European Bee Traits Database (Roberts, unpublished). The dataset is a CSV file and is structured as described below:
- bee_species: bee species names with the structure "genus_species"
- bee_genus: bee genera
- bee_family: bee families
- nesting: nesting type with five categories: vegetation and cavities, parasite, ground, cavities, deadwood
- sociality: type of social system with four categories: communal, parasitic, social, solitary
- specialisation: type of food specialisation with three categories: oligolectic, polylectic, parasitic
- activity_period_months: activity period per year with the categories 2-9 (months)
- month_1st_flying: month of first emergence: February, March, April, May, June, July
- proboscis_length: length of proboscis with two categories: long, short
- red_list: Red List Status with IUCN categories: 2, 3, G, no_data, not_threatened, V
The following variable is not available in this repository until European Bee Traits Database is published by S. Roberts et al.
ITD_females: Mean intertegular distance (ITD) per species from European Bee Traits Database
Scripts
The R scripts provided were written in R Version 4.5.1. The scripts include the following:
01_GLMM:
- Description: The R script produces the LM(M) analyses on a garden/year-level and a survey-level
- Input: Wildbees_features_garden_year.csv; Wildbees_features_survey.csv
02_RLQ: - Description: The R script computes the RLQ and fourth corner analyses and produces Figure 5
- Input: Wildbees_features_garden_year.csv; Wildbees_features_survey.csv; Wildbees_traits_taxonomy_excl_ITD.csv
- Output: figure_5
03_NMDS_garden_level:
- Description: The R script computes the NMDS and vector analysis on garden/year-level and creates three files
that are needed as input for the script 04_Figures_NMDS_garden_level - Input: Wildbees_features_garden_year.csv; Wildbees_traits_taxonomy_excl_ITD.csv
- Output: NMDS_nms_spec_traits_gy10.csv; NMDS_en_coord_gy10.csv; NMDS_data.scores.gy10.csv
03_NMDS_survey_level:
- Description: The R script computes the NMDS and vector analysis on survey-level and creates three files
that are needed as input for the script 04_Figures_NMDS_survey_level - Input: Wildbees_features_survey.csv; Wildbees_traits_taxonomy_excl_ITD.csv
- Output: NMDS_en_coord10.csv; NMDS_nms_spec_traits10.csv; NMDS_data.scores10.csv
04_Figures_NMDS_garden_level:
- Description: the R script produces Figure S5 (NMDS and vector analysis on garden/year-level);
run script 03_NMDS_garden_level first to produce input files - Input: NMDS_nms_spec_traits_gy10.csv; NMDS_en_coord_gy10.csv; NMDS_data.scores.gy10.csv
- Output: figure_S5 (a-f)
04_Figures_NMDS_survey_level:
- Description: The R script produces Figure 4 (NMDS and vector analysis on survey-level);
run script 03_NMDS_survey_level first to produce input files - Input: NMDS_en_coord10.csv; NMDS_nms_spec_traits10.csv; NMDS_data.scores10.csv
- Output: figure_4 (a-f)
04_Figures_GLMM:
- Description: The R script produces Figure 3 and calculates the descriptive statistics of
bee diversity indices and garden features - Input: Wildbees_features_garden_year.csv; Wildbees_features_survey.csv
- Output: figure_3
04_Figures_traits_overview:
- Description: The R script produces Figure 2 and the descriptive statistics for intertegular distance (ITD)
- Input: Wildbees_traits_taxonomy_excl_ITD.csv; Wildbees_features_survey.csv
- Output: figure_2
04_Figures_species_overview:
- Description: The R script produces Figures 1 (Rank-abundance curve) and S4 (Bee occurrences per garden)
- Input: Wildbees_features_survey.csv
- Output: figure_1; figure_s4
05_INEXT:
- Description: the R script produces a sample-size-based rarefaction-extrapolation curve (Figure S3), and computes the sample coverage (SC)
- Input: Wildbees_features_garden_year.csv
- Output: figure_s3
References:
Neumann, A. E., Conitz, F., Karlebowski, S., Sturm, U., Schmack, J. M. & Egerer, M. (2024) Flower richness is key to pollinator abundance: The role of garden features in cities. Basic and Applied Ecology, 79, 102–113. https://doi.org/10.1016/j.baae.2024.06.004
Neumann, A. E., Conitz, F., Karlebowski, S., Sturm, U., Schmack, J., & Egerer, M. (2024). Garden features, diversity and abundance of pollinators in urban community gardens [Data set]. In Basic and Applied Ecology (Bd. 79, S. 102–113). Zenodo. https://doi.org/10.5281/zenodo.10961505
