| Title: | Estimate Pollinator Body Size and Co-Varying Ecological Traits |
|---|---|
| Description: | Tools to estimate pollinator body size and co-varying traits. This package contains Bayesian predictive models of pollinator body size (for bees and hoverflies) and bee foraging range, as well as preexisting predictive models for pollinator body size (currently implemented for ants, bees, butterflies, flies, moths and wasps), bee tongue length, foraging range, total field nectar loads and wing loading. An additional GitHub repository <https://github.com/liamkendall/pollimetrydata> provides model objects to use the bodysize and foraging.range functions internally. The Bayesian models are described in Kendall et al. (2019) <doi:10.1002/ece3.4835> & Kendall et al. (2022) <doi:10.1002/ecy.3809>. |
| Authors: | Liam Kendall [aut, cre], Ignasi Bartomeus [aut] |
| Maintainer: | Liam Kendall <[email protected]> |
| License: | GPL (>= 2) |
| Version: | 1.1.1 |
| Built: | 2026-11-03 12:19:18 UTC |
| Source: | https://github.com/liamkendall/pollimetry |
Predict dry body weight (mg) from intertegular distance and covariates using the fitted models of Kendall et al. (2019).
bodysize(x, taxa, type)bodysize(x, taxa, type)
x |
A nonempty data frame with positive, finite ITD measurements in mm. Sex (Female or Male) is required except for type = "ITD". Taxonomic models also require Family for bees or Subfamily for hoverflies. Accepted hoverfly subfamilies are Eristalinae, Pipizinae and Syrphinae. Optional grouping columns are Region and Species (Genus_species); Species requires Region. The phylogenetic model requires both Region and Species. |
taxa |
One string: "bee" or "hov". |
type |
One string: "taxo", "sex", "ITD", or "phylo" (bees only). |
With Region and Species, both fitted grouping effects are included. With Region alone, only the regional effect is included. With neither, group effects are excluded (set to zero, not integrated out). Species alone is rejected because the fitted species effect is nested within Region. New grouping levels use brms uncertainty sampling from existing levels; this does not place a new species on a phylogenetic tree. Fixed-effect categories must be supported by the fitted model. Est.Weight is exp(mean(log-scale predictive draws)), not arithmetic mean weight. Intervals include residual variation. Use set.seed() for reproducibility. Requires brms. Uses pollimetrydata (>= 1.0.1) when installed; otherwise downloads only the required fitted models from GitHub. Downloaded models are cached in memory for the current R session. An internet connection is required for each model's first download in a session. No Bayesian models are fitted during prediction.
The input data frame with Est.Weight, CI_Lower and CI_Upper appended, in mg. Bounds are the 5th and 95th percentiles of the posterior predictive distribution.
Kendall et al. (2019). Pollinator size and its consequences: Robust estimates of body size in pollinating insects. Ecology and Evolution, 9, 1702-1714. doi:10.1002/ece3.4835.
if (requireNamespace("pollimetrydata", quietly = TRUE) && utils::packageVersion("pollimetrydata") >= "1.0.1") { x <- data.frame(ITD = c(1.5, 2), Sex = c("Female", "Male"), Subfamily = c("Pipizinae", "Syrphinae")) bodysize(x, taxa = "hov", type = "taxo") }if (requireNamespace("pollimetrydata", quietly = TRUE) && utils::packageVersion("pollimetrydata") >= "1.0.1") { x <- data.frame(ITD = c(1.5, 2), Sex = c("Female", "Male"), Subfamily = c("Pipizinae", "Syrphinae")) bodysize(x, taxa = "hov", type = "taxo") }
A dataset of 425 foraging range estimates, with body size, sociality, taxonomic and study metadata.
data(forage_dataset)data(forage_dataset)
A data frame with 425 rows and 23 columns.
publicationSource publication and publication year.
yearSource publication and publication year.
regionStudy location and habitat.
countryStudy location and habitat.
habitatStudy location and habitat.
familyTaxonomic identifiers and sex.
genusTaxonomic identifiers and sex.
speciesTaxonomic identifiers and sex.
sexTaxonomic identifiers and sex.
range.typeRange category, potential or realized measure, and measurement method.
measure.typeRange category, potential or realized measure, and measurement method.
metricRange category, potential or realized measure, and measurement method.
NReported sample size.
distanceReported foraging distance in metres.
sdReported uncertainty metadata: standard deviation, standard error and 95 percent confidence interval.
seReported uncertainty metadata: standard deviation, standard error and 95 percent confidence interval.
ci95Reported uncertainty metadata: standard deviation, standard error and 95 percent confidence interval.
itdIntertegular distance in mm.
socialitySocial organisation.
notesOriginal study notes.
dist10Stored log10 foraging distance in kilometres.
range.4Stored combination of range and measure categories.
wgt10Stored predicted log10 body mass in mg used in the original models.
Stored model predictors are missing outside the original training subsets. The model_training attribute contains specifications for two models, including row selections, columns, factor levels, factor attributes and row names required to reconstruct their training data. Body masses have not been re-estimated.
Kendall et al. (2022). The potential and realized foraging movements of bees are differentially determined by body size and sociality. Ecology, 103(11), e3809. doi:10.1002/ecy.3809.
This function is now deprecated and has been superseded by 'foraging.range'
Calculates foraging range from Greenleaf et al. (2007) using intertegular distance (ITD) values, van Nieuwstadt and Iraheta (1996) using head width (HW) values for Meliponini (stingless bees) and Guedot et al. (2009) using dry weight (mg) values for Osmia species.
foragedist(x, type = "GreenleafAll")foragedist(x, type = "GreenleafAll")
x |
A nonempty numeric vector of finite, positive measurements without missing values: intertegular distance (mm) for Greenleaf equations, head width (mm) for Meli equations, or dry body weight (mg) for Osmia. |
type |
A single character string selecting the equation or equation group. Options are "GreenleafAll", GrMhd ("Maximum homing distance"), GrThd ("Typical homing distance"), GrMfd ("Maximum feeder training distance"), GrMcd("Maximum communication distance"),"Osmia", "MeliMR" , "MeliFT" or "MeliAll". See details in Greenleaf et al. (2007), Guedot et al. (2009) and van Nieuwstadt and Iraheta (1996). |
Linear equations can return negative distances for small input values; these indicate inappropriate extrapolation, not biological distances. Values are not truncated to zero. The replacement foraging.range function uses different models and inputs and is not a numerical substitute for these equations.
A numeric vector for a single equation, or a named-column matrix for GreenleafAll and MeliAll. Greenleaf estimates are in kilometres; Meliponini and Osmia estimates are in metres. Rows follow input order. No uncertainty intervals are returned.
Kendall et al. (2019) Pollinator size and its consequences: Robust estimates of body size in pollinating insects. Ecology and Evolution, 9(4), 1702-1714. doi:10.1002/ece3.4835.
van Nieuwstadt, M. G. L., and Ruano Iraheta, C. E. (1996). Relation between size and foraging range in stingless bees (Apidae, Meliponinae). Apidologie, 27(4), 219-228.
Greenleaf et al. (2007) Bee foraging ranges and their relationship to body size. Oecologia, 153, 589-596. doi:10.1007/s00442-007-0752-9.
Guedot et al. (2009). Relationship between body size and homing ability in the genus Osmia (Hymenoptera; Megachilidae). Ecological Entomology, 34(1), 158-161. doi:10.1111/j.1365-2311.2008.01054.x.
van Nieuwstadt, M. G. L., & Iraheta, C. R. (1996). Relation between size and foraging range in stingless bees (Apidae, Meliponinae). Apidologie, 27(4), 219-228.
foragedist(c(10,5,2), type = "MeliMR")foragedist(c(10,5,2), type = "MeliMR")
Predict realized or potential bee foraging ranges using the models of Kendall et al. (2022).
foraging.range( data, model.type = "social", random.effects = "reduced", measure.type = "realized" )foraging.range( data, model.type = "social", random.effects = "reduced", measure.type = "realized" )
data |
A nonempty data frame with positive, finite ITD measurements in mm. The social model requires sociality: "Highly Eusocial", "Primitively Eusocial" or "Solitary". Group effects require species in Genus_species format; genus is derived from species. |
model.type |
One string: "social" (default) or "ITD". Both models use estimated body weight; the social model also uses sociality. |
random.effects |
One string: "reduced" (default, no group effects), "phylo" (genus effect), or "full" (genus and species effects). Publication and metric effects are excluded for all choices. |
measure.type |
One string: "realized" (default) or "potential". |
The response is log10(range in km), so predictions and interval endpoints are back-transformed with 10^x. range.estimate is 10 raised to the mean log10-scale predictive draw, not arithmetic mean distance. Intervals include residual variation. Female body weight is estimated once per input row using the bee sex model without group effects, then reused for both range types. Body-weight uncertainty is not propagated through the range model. Excluded group effects are set to zero, not integrated out. New included grouping levels use uncertainty sampling from existing levels, not a new phylogenetic placement. Use set.seed() for reproducibility. Requires brms. Uses pollimetrydata (>= 1.0.1) when installed; otherwise downloads only the required fitted models from GitHub. Downloaded models are cached in memory for the current R session. An internet connection is required for each model's first download in a session. No Bayesian models are fitted during prediction.
A data frame with two rows per input specimen, typical then maximum range. range.estimate, range.lower and range.upper are in kilometres; bounds give a 95
Kendall et al. (2022). The potential and realized foraging movements of bees are differentially determined by body size and sociality. Ecology, 103(11), e3809. doi:10.1002/ecy.3809.
if (requireNamespace("pollimetrydata", quietly = TRUE) && utils::packageVersion("pollimetrydata") >= "1.0.1") { x <- data.frame(ITD = c(2.9, 2.5), sociality = c("Highly Eusocial", "Solitary")) foraging.range(x) }if (requireNamespace("pollimetrydata", quietly = TRUE) && utils::packageVersion("pollimetrydata") >= "1.0.1") { x <- data.frame(ITD = c(2.9, 2.5), sociality = c("Highly Eusocial", "Solitary")) foraging.range(x) }
Calculates dry body weight (mg) using head width (mm) from Hodar (1997).
headwidthsize(HW, Eq = "H97DB")headwidthsize(HW, Eq = "H97DB")
HW |
A nonempty numeric vector of head widths in mm. All values must be finite, strictly positive and nonmissing. |
Eq |
A single character string selecting an equation from Hodar (1997). Options implemented are: H97DB (Brachycera), H97DN (Nematocera), H97HA (Hymenoptera), H97LH (Heterocera) and H97LR (Rhopalocera). |
A numeric vector of predicted dry weights (mg), one per input measurement.
Kendall et al. (2019) Pollinator size and its consequences: Robust estimates of body size in pollinating insects. Ecology and Evolution, 9(4), 1702-1714. doi:10.1002/ece3.4835.
Hodar, J. A. (1997). The use of regresion equations for the estimation of prey length and biomass in diet studies of insectivore vertebrates. Miscellania Zoologica, 20(2), 1-10.
headwidthsize(HW = c(1, 2, 3), Eq = "H97HA")headwidthsize(HW = c(1, 2, 3), Eq = "H97HA")
Calculates dry body weight (mg) from existing allometries using body length (mm).
lengthsize(BL, Eq = "DIP")lengthsize(BL, Eq = "DIP")
BL |
A nonempty numeric vector of body lengths in mm. All values must be finite, strictly positive and nonmissing. |
Eq |
A single character string selecting one equation or a group of equations. Acronyms denote author, publication date and taxon. DIP, HYM and LEP select the implemented collections for each order. Other group selectors are Brachycera, Nematocera, Asilidae, Bombyliidae, Formicidae, Vespidae and Noctuidea. Taxon labels below identify equation applicability; only these listed group selectors and equation codes are accepted.
Options implemented are:
Hymenoptera
Lepidoptera
|
A numeric vector of predicted dry weights (mg) for one equation, or a numeric matrix for a group of equations. Matrix rows follow input order and columns are named by equation.
Full reference list provided within Kendall et al. (2019) Pollinator size and its consequences: Robust estimates of body size in pollinating insects. Ecology and Evolution, 9(4), 1702-1714. doi:10.1002/ece3.4835.
lengthsize(BL = c(10, 5, 2), Eq = "S80DCR") lengthsize(BL = c(10, 5, 2), Eq = "HYM")lengthsize(BL = c(10, 5, 2), Eq = "S80DCR") lengthsize(BL = c(10, 5, 2), Eq = "HYM")
Calculates body size as dry weight (mg) from the equations described by Sample (1993) and others using body length multiplied by body width (mm squared).
lengthwidthsize(BLW, Eq = "DIP")lengthwidthsize(BLW, Eq = "DIP")
BLW |
A nonempty numeric vector of body length multiplied by body width, in square millimetres (mm squared). All values must be finite, strictly positive and nonmissing. |
Eq |
A single character string selecting an equation or the LEP group. Options implemented are:
|
A numeric vector of predicted dry weights (mg) for one equation, or a numeric matrix for a group of equations. Matrix rows follow input order and columns are named by equation.
Kendall et al. (2019) Pollinator size and its consequences: Robust estimates of body size in pollinating insects. Ecology and Evolution, 9(4), 1702-1714. doi:10.1002/ece3.4835.
Sample et al. (1993) Estimation of insect biomass by length and width. American Midland Naturalist, 234-240.
lengthwidthsize(BLW = c(3, 5, 2), Eq = "Brachycera") lengthwidthsize(BLW = c(3, 5, 2)) lengthwidthsize(BLW = c(3, 5, 2), Eq = "LEP")lengthwidthsize(BLW = c(3, 5, 2), Eq = "Brachycera") lengthwidthsize(BLW = c(3, 5, 2)) lengthwidthsize(BLW = c(3, 5, 2), Eq = "LEP")
Calculates total field nectar load (ul) using body length (mm) from Henry & Rodet (2018).
nectarload(BL)nectarload(BL)
BL |
A nonempty numeric vector of finite, positive body lengths (mm), without missing values. |
A numeric vector of total field nectar load estimates in microlitres, one per input measurement.
Kendall et al. (2019) Pollinator size and its consequences: Robust estimates of body size in pollinating insects. Ecology and Evolution, 9(4), 1702-1714. doi:10.1002/ece3.4835.
Henry, M., & Rodet, G. (2018). Controlling the impact of the managed honeybee on wild bees in protected areas. Scientific reports, 8(1), 9308. doi:10.1038/s41598-018-27591-y.
nectarload(BL=c(10,5,2))nectarload(BL=c(10,5,2))
A dataset of 4,434 bee and hoverfly specimens, containing dry body mass (mg), intertegular distance (mm), body length (mm), taxonomy and collection metadata.
data(pollimetry_dataset)data(pollimetry_dataset)
A data frame with 4,434 rows and 26 columns.
SuperfamilyTaxonomic identifiers.
FamilyTaxonomic identifiers.
SubfamilyTaxonomic identifiers.
TribeTaxonomic identifiers.
GenusTaxonomic identifiers.
SubgenusTaxonomic identifiers.
SpeciesTaxonomic identifiers.
SexSpecimen sex.
Spec.wgtDry body mass in mg.
ITIntertegular distance in mm.
BLBody length in mm.
TagSpecimen identifier.
RegionGeographical and collection-location metadata.
CountryGeographical and collection-location metadata.
LocalityGeographical and collection-location metadata.
LocationGeographical and collection-location metadata.
LatitudeCollection coordinates in decimal degrees.
LongitudeCollection coordinates in decimal degrees.
MeasurementOriginal measurement, preservation, collection-date, plant and collection-method metadata.
Pres.timeOriginal measurement, preservation, collection-date, plant and collection-method metadata.
Col.dateOriginal measurement, preservation, collection-date, plant and collection-method metadata.
PlantOriginal measurement, preservation, collection-date, plant and collection-method metadata.
Col.methodOriginal measurement, preservation, collection-date, plant and collection-method metadata.
log(Spec.wgt)Stored transformed predictors and grouping identifier used by the original models.
log(IT)Stored transformed predictors and grouping identifier used by the original models.
Region:SpeciesStored transformed predictors and grouping identifier used by the original models.
Original observations are retained. Stored model predictors are missing outside the original training subsets. The model_training attribute contains specifications for seven models, including row selections, columns, factor levels, factor attributes and row names required to reconstruct their training data.
Kendall et al. (2019). Pollinator size and its consequences: Robust estimates of body size in pollinating insects. doi:10.1002/ece3.4835.
Combined training measurements from Cariveau et al. (2016) and Melin et al. (2019), covering six bee families, including Melittidae.
data(tongue_dataset)data(tongue_dataset)
A data frame with 112 rows and eight columns.
FamilyBee family.
mean_tongue_length_mmMean total proboscis length in mm.
ITMean intertegular distance in mm.
mean_glossa_length_mmMean glossa length in mm.
mean_prementum_length_mmMean prementum length in mm.
genusGenus and species identifiers retained from each source.
speciesGenus and species identifiers retained from each source.
sourceSource publication.
Contains the 101 original Cariveau training rows followed by 11 Melin species means. Melin measurements are averaged within Family, genus and species using the same aggregation as the prediction function previously used. Cariveau rows are retained without further aggregation. This is the combined training dataset used by tonguelength; no observations have been added. The original Cariveau file was obtained from the ibartomeus/traitbase repository (raw_data/Cariveau_2016.rda).
Cariveau et al. (2016). The Allometry of Bee Proboscis Length and Its Uses in Ecology. doi:10.1371/journal.pone.0151482.
Melin et al. (2019). The allometry of proboscis length in Melittidae (Hymenoptera: Apoidae) and an estimate of their foraging distance using museum collections. doi:10.1371/journal.pone.0217839.
Calculates tongue length (mm) from Cariveau et al. (2016) and Melin et al. (2019) using intertegular distance (ITD) values (mm).
tonguelength(x, mouthpart = "all")tonguelength(x, mouthpart = "all")
x |
A dataframe with the following two columns: IT (finite, positive intertegular distance in mm) and Family (capital F). Missing measurements are not accepted. Only six out of the extant seven families are implemented: "Andrenidae", "Apidae", "Colletidae", "Halictidae", "Melittidae" and "Megachilidae". |
mouthpart |
The mouthpart you are interested in. Options are: "all", "glossa", "prementum" and "tongue" (i.e. glossa + prementum) |
Models are fitted to tongue_dataset, which combines the Cariveau data with species means from Melin et al. (2019). Predictions and confidence bounds are exponentiated from the natural-log scale. They describe fitted geometric means, not arithmetic means or individual prediction intervals. Total tongue length is modelled separately, so its prediction need not equal the sum of separately predicted glossa and prementum lengths. No data are downloaded during a call.
The input data frame with predicted mouthpart lengths (mm) and 95
Kendall et al. (2019) Pollinator size and its consequences: Robust estimates of body size in pollinating insects. Ecology and Evolution, 9(4), 1702-1714. doi:10.1002/ece3.4835.
Cariveau et al. (2016) The Allometry of Bee Proboscis Length and Its Uses in Ecology. PLOS ONE, 11(3): e0151482. doi:10.1371/journal.pone.0151482.
Melin et al. (2019) The allometry of proboscis length in Melittidae (Hymenoptera: Apoidae) and an estimate of their foraging distance using museum collections. PLOS ONE, 14(6), e0217839. doi:10.1371/journal.pone.0217839.
example=cbind.data.frame(IT=c(1.3,2.3), Family=c("Andrenidae","Apidae")) tonguelength(example,mouthpart="all")example=cbind.data.frame(IT=c(1.3,2.3), Family=c("Andrenidae","Apidae")) tonguelength(example,mouthpart="all")
Calculates wing loading (mg/mm^2) expressed as dry weight per total wing area using intertegular distance (mm) from Bullock (1999).
wingloading(IT)wingloading(IT)
IT |
A nonempty numeric vector of finite, positive intertegular distances (mm), without missing values. |
A numeric vector of wing-loading estimates (mg/mm^2), one per input measurement.
Kendall et al. (2019) Pollinator size and its consequences: Robust estimates of body size in pollinating insects. Ecology and Evolution, 9(4), 1702-1714. doi:10.1002/ece3.4835.
Bullock, S. H. (1999). Relationships among body size, wing size and mass in bees from a tropical dry forest in Mexico. Journal of the Kansas Entomological Society, 72(4), 426-439.
wingloading(IT=c(10,5,2))wingloading(IT=c(10,5,2))