Data and R code for: Beyond the treeline: Are wood-nesting bees and wasps limited by nesting habitat at high elevations?
Data files
Apr 03, 2026 version files 202.66 KB
-
data_and_scripts_wong_and_forrest_ecol_2026.zip
141.50 KB
-
README.md
61.16 KB
Abstract
Although climate suitability is often thought to be the most important determinant of species ranges, non-climate variables such as biotic interactions, dispersal abilities, and habitat quality may play equally important roles as range-limiting factors. For some organisms, the constraints imposed by these non-climate variables may explain their failure to establish in novel habitats that appear suitable with respect to climate. Determining whether or not organisms can respond to rising temperatures via range shifts, therefore, requires understanding the extent to which non-climate variables limit species ranges. We examined the potential for range shifts in montane populations of wood-nesting bees and wasps in the Colorado Rocky Mountains and assessed the extent to which future range shifts to higher elevations may be limited by the lack of wood substrates beyond treeline. We tracked wood-nesting bee and wasp occupancy in artificial wooden nesting structures placed at increasing elevations from treeline and quantified the relative abundance of wood versus ground-nesting bees and wasps at each site. Over the course of the study, wood-nesting bee or wasp nesting activity was observed at least once at all sites, regardless of distance from treeline. The total number of nests constructed at each site decreased with increasing elevation; however, the average number of offspring per nest remained constant for the three most commonly observed taxa. The abundance of wood-nesting bees and wasps declined with increasing elevation more rapidly than that of ground-nesting bees and wasps. These findings suggest that wood-nesting bees and wasps are capable of nesting beyond treeline, but that the extent to which their ranges can shift upwards in elevation may be limited by the lack of nesting substrate. Our work highlights the importance of considering non-climate variables such as essential habitat requirements in evaluating the capacity of organisms to respond adaptively to climate change.
Ecology, 2026
Lydia H. Wong & Jessica R. K. Forrest
Correspondence: lwong014@uottawa.ca
This README file describes the data package "data_and_scripts_wong_and_forrest_ecol_2026.zip" which accompanies the above publication.
File structure and organization
The folder and associated R project file: data_and_scripts_wong_and_forrest_ecol_2026 contains two sub-folders: (1) data and (2) scripts. The workflow is as follows:
data > raw --> scripts > compile --> data > compiled --> scripts > analysis
- The R scripts in the
scripts > compilesub-folder read from CSV files containing raw data in thedata > rawsub-folder. The scripts write CSV files containing compiled data to thedata > compiledsub-folder. - The R scripts in the
scripts > analysesub-folder read from the CSV files containing compiled data in thedata > compiledsub-folder to perform analyses and create figures
Folder descriptions
Folder: data
Sub-folder 1: raw
Description: Contains raw data CSV files (data collected from the field) for trap-nest occupancy, floral surveys, insect surveys, site characteristics (elevation, aspect, coordinates).
Contents:
data_raw_floral_counts.csvdata_raw_insect_survey_data.csv— insects observed during insect surveysdata_raw_occupancy.csvdata_raw_site_characteristics.csvdata_raw_survey_weather_conditions.csv
Sub-folder 2: compiled
Description: Contains compiled CSV files (e.g. total numbers of nests per site, total insect counts), combined with flower, and site data.
Contents:
data_compiled_cells_per_nest.csvdata_compiled_insect_survey_counts.csvdata_compiled_nests_per_site.csv
Folder: scripts
Sub-folder 1: compile
Description: Contains R script files that: (1) read in raw data from data > raw sub-folder, perform calculations (e.g. totals, averages), and combines data from different files (e.g. combine trap-nest data with floral data and site data), and (2) write compiled data in CSVs to the compiled folder to be used in analysis.
Contents:
compile_survey data.Rcompile_trap_nest_data
Sub-folder 2: analysis
Description: Contains R script files that perform statistical analysis and generates figures using compiled data in the data > compiled sub-folder.
Contents:
analysis_occupancy.Ranalysis_insect_surveys.R
Metadata for data files:
File: data > raw > data_raw_floral_counts.csv
Description: Raw flower counts from floral surveys; number of flowers of each plant taxon counted per survey occasion
| column_name | variable_type | number_of_NAs | range_or_possible_values | units_formats_abbreviations | description |
|---|---|---|---|---|---|
| year | factor | 0 | 2021 - 2023 | NA | Year of survey; coded as factor in models |
| mountain | character | 0 | AV, BD | BD = Mount Baldy, AV = Avery Peak | Mountain of survey site |
| site | factor | 0 | 1 to 8 | NA | Site number (AV: 1 - 6, BD: 1 - 8) |
| dateSurveyed | date | 0 | e.g., 2022-07-17, 2022-07-18, 2021-07-06 | yyyy-mm-dd | Date on which survey occurred |
| doy | integer | 0 | 163 - 223 | NA | Day of year on which survey occurred |
| transect | integer | 0 | 1 - 999 | NA | Transect in which the flower was counted. There were 4 transects per site within which flowers were counted. Oon some survey occasions flower counts across all transects were aggregated in the field; in these cases, a value 999 was assigned to the transect number |
| flowerTaxon | character | 0 | e.g., Achillea, Agoseris, Agoseris aurantiaca | NA | Name of the flower taxon counted |
| aster | character | 0 | yes, no | NA | Whether or not the flower taxon is in the plant family Asteraceae |
| count | numeric | 0 | 0 - 3608 | NA | Number of floral units counted |
| transectWidth | numeric | 0 | 0.1 - 1 | metres (m) | Width of the transect (varying widths were used for different taxa) |
| transectLength | numeric | 0 | 12.4 - 120 | metres (m) | Length of the transect; lengths were generally 30 m, but were sometimes cut short by large snow drifts. Values of 120 used when counts were aggregated in the field across all transects (120 m = the total length) |
| transectArea | numeric | 0 | 2.2 - 120 | square metres (m^2) | Transect area for the specific plant taxon: transectWidth * transectLength |
| observer | character | 0 | LW, EF, RT | LW = Lydia Wong, EF = Erin Francispillai, RT = Rohan Tripathy | Initials of the individual who counted the flowers |
File: data > raw > data_raw_insect_survey_data.csv
Description: Raw insect survey data; insects observed during insect surveys, nesting habits, and weblinks to iNaturalist observations (if any).
| column_name | variable_type | number_of_NAs | range_or_possible_values | units_formats_abbreviations | description |
|---|---|---|---|---|---|
| year | factor | 0 | 2021 - 2023 | NA | Year of survey; coded as factor in models |
| mountain | character | 0 | AV, BD | BD = Mount Baldy, AV = Avery Peak | Mountain of survey site |
| site | factor | 0 | 1 to 8 | NA | Site number (AV: 1 - 6, BD: 1 - 8) |
| yrMtSite | character | 0 | e.g., 2021AV1, 2021AV2, 2021AV3 | YearMountainSite; BD = Mount Baldy, AV = Avery Peak, WG = West Gothic | Unique composite site-name variable (year-mountain-site number) |
| dateSurveyed | date | 0 | e.g., 6/24/2021, 7/2/2021, 7/3/2021 | mm/dd/yyyy | Date on which survey occurred |
| doySurveyed | integer | 0 | 163 - 223 | NA | Day of year on which survey occurred |
| startTime | time | 0 | e.g., 9:12:00, 9:54:00, 10:39:00 | hh:mm:ss | Time of day at which survey occurred |
| startTime_s | integer | 0 | 32940 - 60360 | seconds | Time of day at which survey occurred in seconds after midnight |
| survID | character | 0 | e.g., 2021AV1-175, 2021AV2-175, 2021AV3-175 | YearMountainSite-Day; BD = Mount Baldy, AV = Avery Peak, WG = West Gothic | Unique survey ID (year, mountain, site number, day of year of survey) |
| quadrant | factor | 0 | 1 to 4 | NA | Quadrant in which the insect was observed. Each site was divided into 4 |
| insect | character | 0 | Bee, Wasp | NA | Insect category of the observation |
| taxon | character | 0 | e.g.,Lasioglossum, Megachile melanophaea, Panurginus | NA | Taxonomic identity of the observed insect (refined after verification from iNat photos if any) |
| confidence | character | 2516 | e.g., uncertain, voucher | NA | Note included regarding LW's confidence about taxonomic identity ascribed in the field |
| photoFile | character | 2498 | e.g., IMG_5346.JPG, IMG_20210702_103513.jpg | NA | Image file name if a photo was taken of the insect |
| iNatLink | character | 2511 | e.g., https://www.inaturalist.org/observations/85693280 | NA | iNaturalist link for the obseration (if photo was taken, and submitted) |
| iNat_identifier | character | 2531 | e.g., johnascher, susanna_h | NA | Username of who provided an identification from iNaturalist |
| nestHabit | character | 0 | ground, cavity | ground = Ground-nesting; cavity = Wood-nesting | Nesting habit of the observed insect |
| flagNestHabit | character | 0 | Bombus, possibly ambiguous, marked | NA | Flag status of observation - Bumble bees were initially included in surveys but removed from the dataset for analysis. "Possibly ambiguous" was scored if there was potential ambiguity regarding whether or not the observed individual was wood-nesting. "Marked" was scored if an insect seen during the survey had a paint mark (i.e. was a trap-nest occupant) |
File: `data > raw > data_raw_occupancy.csv
Description: Raw trap-nest occupancy data; number of brood cells observed in occupied nests at each site visit (some nests have multiple rows as they were active for multiple site visits)
| column_name | variable_type | number_of_NAs | range_or_possible_values | units_formats_abbreviations | description |
|---|---|---|---|---|---|
| year | factor | 0 | 2021 - 2023 | NA | Year of observation; coded as factor in models |
| mountain | character | 0 | AV, BD, WG | BD = Mount Baldy, AV = Avery Peak, WG = West Gothic | Mountain of observation site |
| site | factor | 0 | 1 to 8 | NA | Site number (AV: 1 - 6, BD: 1 - 8, WG: 1 - 5) |
| currentDate | date | 0 | e.g., 8/4/2021, 7/12/2021, 7/20/2021 | mm/dd/yyyy | Date on which observation occurred |
| nestID | character | 0 | e.g., AV1-A10, AV1-A2, AV1-A4 | BD = Mount Baldy, AV = Avery Peak, WG = West Gothic | Unique nest ID consisting of the Mountain, Site number, a letter from A to C (denoting 1 of the 3 trap-nests at each site), and a number (denoting the cavity number within the trap-nest) |
| occupant | character | 0 | e.g., Hoplitis fulgida, Osmia subaustralis, Osmia tristella | NA | Full taxonomic identity of the nest occupant |
| genus | character | 0 | Hoplitis, Osmia, Megachile, Eumenine, Passaloecus, Cephlaosmia, Aster specialist, Hylaeus | NA | Genus of the nest occupant |
| species | character | 0 | fulgida, subaustralis, unknown, sp., tristella, montana, albifrons | NA | Species of the nest occupant |
| paint | character | 0 | e.g., orange, none, dnr | dnr = "did not record"; these occupants may have been marked, but their mark colour was not recorded | Colour of paint mark used to mark the occupant |
| totalCells | numeric | 201 | 0 - 20 | NA | Total number of brood cells in the nest. Brood cells were only counted for certain taxa; NAs entered for cases when there was no count |
| notes | character | 825 | NA | NA | Notes from LW made in the field |
| entryNotes | character | 1028 | NA | NA | Notes from LW made during data entry |
File: `data > raw > data_raw_site_characteristics.csv
Description: Site data (elevation, coordinates, aspect, number of nesting cavities available)
| column_name | variable_type | number_of_NAs | range_or_possible_values | units_formats_abbreviations | description |
|---|---|---|---|---|---|
| mountain | character | 0 | AV, BD, WG | BD = Mount Baldy, AV = Avery Peak, WG = West Gothic | Mountain |
| site | factor | 0 | 1 to 8 | NA | Site number (AV: 1 - 6, BD: 1 - 8, WG: 1 - 5) |
| numCavities | integer | 0 | 30 - 42 | NA | Total number of available cavities across all 3 trap-nests at the site |
| elevation | numeric | 0 | 3443 - 3717 | metres (m) | Elevation of the site (a.s.l.); determined using a TrimbleX GPS unit |
| latitude | numeric | 0 | NA | NA | Latitude of the site |
| longitude | numeric | 0 | NA | NA | Longitude of the site |
| meanAspect | numeric | 0 | 101.7919121 - 282.7748194 | NA | Mean aspect of the site |
File: `data > raw > data_raw_survey_weather_conditions.csv
Description: Raw survey weather data; measurements of air temperature, wind speed, cloud cover taken before, during, and after inset surveys
| column_name | variable_type | number_of_NAs | range_or_possible_values | units_formats_abbreviations | description |
|---|---|---|---|---|---|
| year | factor | 0 | 2021 - 2023 | NA | Year of survey; coded as factor in models |
| mountain | character | 0 | AV, BD | BD = Mount Baldy, AV = Avery Peak | Mountain of survey site |
| site | factor | 0 | 1 to 8 | NA | Site number (AV: 1 - 6, BD: 1 - 8) |
| date | date | 0 | e.g., 7/10/2021, 7/12/2021, 7/15/2021 | mm/dd/yyyy | Date on which survey occurred |
| doy | integer | 0 | 163 - 223 | NA | Day of year on which survey occurred |
| survID | character | 0 | e.g., 2021AV6-191, 2021AV4-193, 2021AV5-193 | YearMountainSite-Day; BD = Mount Baldy, AV = Avery Peak, WG = West Gothic | Unique survey ID (year, mountain, site number, day of year of survey) |
| measurement | integer | 0 | 1 to 3 | NA | Weather measurement number; 3 measurements were taken per survey |
| temperature | numeric | 20 | 9.5 - 31.5 | ° Celsius | Air temperature taken with a Kestrel weather meter; temperature measurements started mid-season in 2021; hence the NAs |
| windAvg | numeric | 16 | 0 - 4.15 | metres per second (m/s) | Average windspeed taken with a Kestrel weather metre recorded over a 15 second sample period per measurement; measurements started later in the study (hence the NAs) |
| windMax | numeric | 91 | 0 - 5.4 | metres per second (m/s) | Maximum windspeed taken with a Kestrel weather metre recorded over a 15 second sample period per measurement; wind measurements started mid-season in 2021; hence the NAs |
| windMin | numeric | 16 | 0 - 3.8 | metres per second (m/s) | Minimum windspeed taken with a Kestrel weather metre recorded over a 15 second sample period per measurement; wind measurements started mid-season in 2021; hence the NAs |
| cloud | integer | 3 | 0 - 100 | Percentage | Visual estimate of cloud cover (all estimates made by LW); measurements were missed on some occasions (NAs) |
| sun | character | 76 | sun, clear, hiding, part hide, DNR | "sun" or "clear" = sun is visible, few clouds, LW can see her shadow; "hiding" or "part hide" = sun is behind a cloud, "DNR" = did not record | Visual evaluation of sunniness; measurements started later in the study (hence the NAs) |
| notes | character | 447 | NA | NA | Notes made by LW in the field |
File: `data > compiled > data_compiled_nests_per_site.csv
Description: Compiled data frame containing the total number of occupied cavities at each site in each year of the study. Also contains the maximum floral density observed at the site, and site characteristics (elevation and aspect). Each row of data corresponds to 1 site in a given year of the study. This data frame was used to test the relationship between the number of occupied cavities and elevation (prediction 1)
| column_name | variable_type | number_of_NAs | range_or_possible_values | units_formats_abbreviations | description |
|---|---|---|---|---|---|
| year | factor | 0 | 2021 - 2023 | NA | Year of survey; coded as factor in models |
| mountain | character | 0 | AV, BD, WG | BD = Mount Baldy, AV = Avery Peak, WG = West Gothic | Mountain of observation site |
| site | integer | 0 | 1 to 8 | NA | Site number (AV: 1 - 6, BD: 1 - 8, WG: 1 - 5) |
| numCavities | integer | 0 | 30 - 42 | NA | Total number of available cavities across all 3 trap-nests at the site |
| elevation | numeric | 0 | 3443 - 3717 | metres (m) | Elevation of the site (a.s.l.); determined using a TrimbleX GPS unit |
| meanAspect | numeric | 0 | 101.7919121 - 282.7748194 | NA | Mean aspect of the site |
| yrNestID | character | 0 | e.g., 2021-AV1-A10, 2021-AV1-A2, 2021-AV1-A4 | NA | Unique nest identity (year, mountain, site number, trap-nest letter, cavity number) |
| occupant2 | character | 0 | Hoplitis spp., Cephalosmia, Osmia tristella | NA | Second occupant taxonomic identification; grouped into Cephalosmia (Osmia montana, Osmia subaustralis), Osmia tristella, and Hoplitis spp. (Hoplitis albifrons, Hoplitis fulgida) |
| startNestDoy | integer | 0 | 186 - 229 | NA | Day of year on which a nest was first observed |
| cellsPerNest | numeric | 0 | 0 - 20 | NA | Number of brood cells in the nest; decimal values used to indicate partial nest; value of zero assigned if only wall material present |
| floralDensity | numeric | 81 | 0.03 - 284.07 | flowers per metre square | Total floral density (summed across all plant taxa and transects) for the date on which the nest was first observed (only includes Aster density if used as a predictor for Cephalosmia); no flower surveys at West Gothic (source of NA) |
File: `data > compiled > data_compiled_cells_per_nest.csv
Description: Compiled data frame containing the total number of brood cells in each nest, the total floral density for the date on which the nest was first initiated (aster density only for Cephalosmia spp.), site characteristics (elevation and aspect). Each row of data corresponds to 1 nest observed during the study. This data frame was used to test the relationship between the number of brood cells per nest and elevation (prediction 2)
| column_name | variable_type | number_of_NAs | range_or_possible_values | units_formats_abbreviations | description |
|---|---|---|---|---|---|
| year | factor | 0 | 2021 - 2023 | NA | Year of survey; coded as factor in models |
| mountain | character | 0 | AV, BD, WG | BD = Mount Baldy, AV = Avery Peak, WG = West Gothic | Mountain of observation site |
| site | integer | 0 | 1 to 8 | NA | Site number (AV: 1 - 6, BD: 1 - 8, WG: 1 - 5) |
| numCavities | integer | 0 | 30 - 42 | NA | Total number of available cavities across all 3 trap-nests at the site |
| elevation | numeric | 0 | 3443 - 3717 | metres (m) | Elevation of the site (a.s.l.); determined using a TrimbleX GPS unit |
| meanAspect | numeric | 0 | 101.7919121 - 282.7748194 | NA | Mean aspect of the site |
| yrNestID | character | 0 | e.g., 2021-AV1-A10, 2021-AV1-A2, 2021-AV1-A4 | NA | Unique nest identity (year, mountain, site number, trap-nest letter, cavity number) |
| occupant2 | character | 0 | Hoplitis spp., Cephalosmia, Osmia tristella | NA | Second occupant taxonomic identification; grouped into Cephalosmia (Osmia montana, Osmia subaustralis), Osmia tristella, and Hoplitis spp. (Hoplitis albifrons, Hoplitis fulgida) |
| startNestDoy | integer | 0 | 186 - 229 | NA | Day of year on which a nest was first observed |
| cellsPerNest | numeric | 0 | 0 - 20 | NA | Number of brood cells in the nest; decimal values used to indicate partial nest; value of zero assigned if only wall material present |
| floralDensity | numeric | 81 | 0.03 - 284.07 | flowers per metre square | Total floral density (summed across all plant taxa and transects) for the date on which the nest was first observed (only includes Aster density if used as a predictor for Cephalosmia); no flower surveys at West Gothic (source of NA) |
File: `data > compiled > data_compiled_insect_survey_counts.csv
Description: Compiled data frame containing the total counts of insects, total counts of wood-nesting insects, and total counts of ground-nesting insects observed per survey. Also contains the total floral density for the date on which the survey was conducted, the average weather conditions characterizing the survey date, and site characteristics (elevation and aspect). Each row of data corresponds to 1 survey occasion. This data frame was used to test the relationship between the relative abundance of ground- vs wood-nesting insects and elevation (prediction 3).
| column_name | variable_type | number_of_NAs | range_or_possible_values | units_formats_abbreviations | description |
|---|---|---|---|---|---|
| mountain | character | 0 | AV, BD | BD = Mount Baldy, AV = Avery Peak | Mountain of observation site |
| site | integer | 0 | 1 to 8 | NA | Site number (AV: 1 - 6, BD: 1 - 8, WG: 1 - 5) |
| year | factor | 0 | 2021 - 2023 | NA | Year of survey; coded as factor in models |
| survID | character | 0 | e.g., 2021AV1-175, 2021AV1-183, 2021AV1-201 | YearMountainSite-Day; BD = Mount Baldy, AV = Avery Peak, WG = West Gothic | Unique survey ID (year, mountain, site number, day of year of survey) |
| yrMtSite | character | 0 | e.g., 2021AV1, 2022AV1, 2023AV1 | YearMountainSite; BD = Mount Baldy, AV = Avery Peak, WG = West Gothic | Unique composite site-name variable (year-mountain-site number) |
| dateSurveyed | character | 0 | e.g., 6/24/2021, 7/2/2021, 7/20/2021 | mm/dd/yyyy | Date on which observation of nest was made |
| doySurveyed | integer | 0 | 163 - 223 | NA | Day of year on which observation of nest was made |
| startTime_s | integer | 0 | 32940 - 60360 | seconds | Time of day at which survey occurred in seconds after midnight |
| totalInsects | integer | 0 | 0 - 34 | NA | Total number of insects across all nesting habits observed during surve period |
| totalGround | integer | 0 | 0 - 33 | NA | Total number of ground-nesting insects observed during survey period |
| totalCavity | integer | 0 | 0 - 5 | NA | Total number of wood-nesting insects observed during survey period |
| totalCavityExclAmbiguous | integer | 0 | 0 - 5 | NA | Total number of wood-nesting insects observed during survey period excluding those that were flagged to have potentially ambiguous nesting habits |
| totalCavityExclMarked | integer | 0 | 0 - 5 | NA | Total number of wood-nesting insects observed during survey period excluding those that were marked trap-nest occupants |
| elevation | numeric | 0 | 3443 - 3717 | metres (m) | Elevation of the site (a.s.l.); determined using a TrimbleX GPS unit |
| meanAspect | numeric | 0 | 101.7919121 - 282.7748194 | NA | Mean aspect of the site |
| meanTemp | numeric | 22 | 11.67 - 30.37 | ° Celsius | Mean air temperature across 3 measurements taken per survey; temperature measurements started mid-season in 2021; hence the NAs |
| meanWind | numeric | 22 | 0.15 - 3.07 | metres per second (m/s) | Average windspeed across 3 measurements of mean windspeed taken per survey; measurements started later in the study (hence the NAs) |
| meanCloud | numeric | 18 | 0 - 100 | Percentage | Average cloud cover estimate acrodd 3 measurements taken per survey; measurements were missed on some occasions (NAs) |
| sun | character | 40 | e.g., NA, hiding/clear, clear/hiding | "sun" or "clear" = sun is visible, few clouds, LW can see her shadow; "hiding" or "part hide" = sun is behind a cloud, "DNR" = did not record | visual evaluation of sunniness (1 observation per survey occasion); measurements started later in the study (hence the NAs) |
| totalFloralDensity | numeric | 0 | 1.82 - 499 | flowers per metre square | Total floral density (summed across all plant taxa and transects) for the date on the insect survey was conducted (or closest date) |
| doyFlowers | integer | 0 | 163 - 223 | NA | Day of the year on which the floral survey for this insect survey was conducted (in some cases was not on the exact same day as insect survey; LW: there were some cases, where I had to count flowers the day after I surveyed pollinators because I was running from a storm or because it got dark. |
