Package {pollimetry}


Type: Package
Title: Estimate Pollinator Body Size and Co-Varying Ecological Traits
Version: 1.1.1-1
Maintainer: Liam Kendall <liam.k.kendall@gmail.com>
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>.
Depends: R (≥ 4.0.0)
Imports: stats, utils, lifecycle, brms (≥ 2.16.1)
Suggests: pollimetrydata (≥ 1.0.1)
License: GPL-2 | GPL-3 [expanded from: GPL (≥ 2)]
LazyData: true
Encoding: UTF-8
Config/roxygen2/version: 8.1.1
URL: https://github.com/liamkendall/pollimetry
BugReports: https://github.com/liamkendall/pollimetry/issues
NeedsCompilation: no
Packaged: 2026-11-09 21:44:51 UTC; liamkendall
Author: Liam Kendall [aut, cre], Ignasi Bartomeus [aut]
Repository: CRAN
Date/Publication: 2026-11-10 08:10:15 UTC

Predict bee and hoverfly dry body weight

Description

Predict dry body weight (mg) from intertegular distance and covariates using the fitted models of Kendall et al. (2019).

Usage

bodysize(x, taxa, type)

Arguments

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).

Details

With Region and Species, both fitted grouping effects are included. With Region alone, the regional effect is included. Population-level predictions use group effects set to zero. Species requires Region because the fitted species effect is nested within Region. New grouping levels use brms uncertainty sampling from existing levels. Fixed-effect categories must be supported by the fitted model. Estimates are back-transformed means with 95 percent Bayesian credible intervals, expressed in milligrams. Uses fitted models from pollimetrydata (>= 1.0.1) when installed, or downloads the required models from GitHub and caches them for the current R session.

Value

The input data frame with Est.Weight and 95 percent Bayesian credible intervals (CI_Lower and CI_Upper) appended, in mg.

References

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.

Examples

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")
}

Bee foraging range measurements.

Description

A dataset of 425 foraging range estimates, with body size, sociality, taxonomic and study metadata.

Usage

data(forage_dataset)

Format

A data frame with 425 rows and 23 columns.

publication

Source publication.

year

Publication year.

region

Geographical region.

country

Study country.

habitat

Study habitat.

family

Bee family.

genus

Bee genus.

species

Bee species.

sex

Bee sex.

range.type

Foraging range category.

measure.type

Potential or realized range.

metric

Method used to measure foraging range.

N

Reported sample size.

distance

Reported foraging distance in metres.

sd

Reported standard deviation.

se

Reported standard error.

ci95

Reported 95 percent confidence interval.

itd

Intertegular distance in mm.

sociality

Social organisation.

notes

Original study notes.

dist10

Base-10 logarithm of foraging distance in kilometres.

range.4

Combined range and measure category.

wgt10

Base-10 logarithm of predicted body mass in mg.

Details

The model_training attribute identifies the training data for two foraging range models. Stored model variables are populated for the corresponding training subsets.

References

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.


(Deprecated) Converts body measurements to measures of foraging range for bees.

Description

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.

Usage

foragedist(x, type = "GreenleafAll")

Arguments

x

A nonempty numeric vector of finite, positive measurements: 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).

Details

Negative estimates from linear equations indicate extrapolation beyond their applicable measurement range.

Value

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.

References

Examples

foragedist(c(10,5,2), type = "MeliMR")


Predict typical and maximum bee foraging ranges

Description

Predict realized or potential bee foraging ranges using the models of Kendall et al. (2022).

Usage

foraging.range(
  data,
  model.type = "social",
  random.effects = "reduced",
  measure.type = "realized"
)

Arguments

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, population-level predictions), "phylo" (genus effect), or "full" (genus and species effects).

measure.type

One string: "realized" (default) or "potential".

Details

Estimates are back-transformed means with 95 percent Bayesian credible intervals, expressed in kilometres. Female body weight is estimated once per input row using population-level predictions from the bee sex model, then reused for both range types. Range estimates and credible intervals are conditional on this estimated body weight. Group effects selected by random.effects contribute to predictions; the remaining group effects are set to zero. New included grouping levels use uncertainty sampling from existing levels. Uses fitted models from pollimetrydata (>= 1.0.1) when installed, or downloads the required models from GitHub and caches them for the current R session.

Value

A data frame with two rows per input specimen, typical then maximum range. Estimated range (range.estimate) and the lower and upper bounds of its 95 percent Bayesian credible interval (range.lower and range.upper) are in kilometres. wgt is estimated female dry weight in mg and wgt10 is its base-10 logarithm. Additional columns include range.type and, when species is supplied, genus.

References

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.

Examples

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)
}

Converts pollinator (Diptera, Hymenoptera and Lepidoptera) head width (mm) to body size (dry weight (mg)).

Description

Calculates dry body weight (mg) using head width (mm) from Hodar (1997).

Usage

headwidthsize(HW, Eq = "H97DB")

Arguments

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).

Value

A numeric vector of predicted dry weights (mg), one per input measurement.

References

Examples

headwidthsize(HW = c(1, 2, 3), Eq = "H97HA")

Converts body length to body size (body weight (mg)) for three pollinating insect groups (Diptera, Hymenoptera and Lepidoptera).

Description

Calculates dry body weight (mg) from existing allometries using body length (mm).

Usage

lengthsize(BL, Eq = "DIP")

Arguments

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:

Diptera

  • All: BN06D, G97D, GR84D, JS00DA, R77D, S80DCF, S80DCR, S80DMF, S93DA, W13D.

  • Brachycera (2 equations): S93DB, Sabo02DB.

  • Nematocera (3 equations): JS00DN, S93DN, Sabo02DN.

  • Asilidae (2 equations): Sabo02DA, S93DB.

  • Bombyliidae (2 equations): S93DB, Sabo02DBB.

  • Cyclorrapha: S93DC.

Hymenoptera

  • All: BN06H1, G97H, G97F, GR84H, JS00HA, R77H, S80HCF, S80HCR, S80HMF, S93HA, Sabo02H, W13H.

  • Formicidae (13 equations): BN06HF, GR84F, JS00HF, R77A, S80FCF, S80FCR, S80FMF, S93HF, S93HH, S93HI, BN06H1, G97H, G97F.

  • Apidae: Sabo02HA.

  • Braconidae: S93HB.

  • Halictidae: S93HH.

  • Ichneumonidae: S93HI.

  • Pompilidae: S93HP.

  • Vespidae: S93HV & Sabo02HV.

Lepidoptera

  • All: BN06L, G97L, JS00L, R77L, S80LCF, S80LCR, S80LMF,S93LA,W13L.

  • Noctuidea: S93LC, S93LN.

  • Geometridae: S93LG.

  • Microlepidoptera: S93LM.

  • Arctiinae: S93LC.

Value

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.

References

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.

Examples

lengthsize(BL = c(10, 5, 2), Eq = "S80DCR")
lengthsize(BL = c(10, 5, 2), Eq = "HYM")

Converts pollinator body length*body width to body size (dry weight (mg)).

Description

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).

Usage

lengthwidthsize(BLW, Eq = "DIP")

Arguments

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:

  • Diptera: Brachycera, Cyclorrapha, DIP (the default general Diptera equation), Nematocera.

  • Hymenoptera: S93HBLW, S93HFLW, S93HHLW, S93HILW, S93HALW, S93HPLW, S93HVLW.

  • Lepidoptera: S93LGLW, S93LMLW, S93LALW, W13LLW, S93LCLW, S93LNLW. LEP returns W13LLW and S93LALW, in that order.

Value

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.

References

Examples

lengthwidthsize(BLW = c(3, 5, 2), Eq = "Brachycera")
lengthwidthsize(BLW = c(3, 5, 2))
lengthwidthsize(BLW = c(3, 5, 2), Eq = "LEP")

Converts bee body length (mm) to total field nectar load (ul).

Description

Calculates total field nectar load (ul) using body length (mm) from Henry & Rodet (2018).

Usage

nectarload(BL)

Arguments

BL

A nonempty numeric vector of finite, positive body lengths (mm), without missing values.

Value

A numeric vector of total field nectar load estimates in microlitres, one per input measurement.

References

Examples

nectarload(BL=c(10,5,2))

Body size measurements of pollinating insects.

Description

A dataset of 4,434 bee and hoverfly specimens, containing dry body mass (mg), intertegular distance (mm), body length (mm), taxonomy and collection metadata.

Usage

data(pollimetry_dataset)

Format

A data frame with 4,434 rows and 26 columns.

Superfamily

Superfamily.

Family

Family.

Subfamily

Subfamily.

Tribe

Tribe.

Genus

Genus.

Subgenus

Subgenus.

Species

Species.

Sex

Specimen sex.

Spec.wgt

Dry body mass in mg.

IT

Intertegular distance in mm.

BL

Body length in mm.

Tag

Specimen identifier.

Region

Geographical region.

Country

Country of collection.

Locality

Collection locality.

Location

Collection location.

Latitude

Latitude in decimal degrees.

Longitude

Longitude in decimal degrees.

Measurement

Measurement information.

Pres.time

Preservation time.

Col.date

Collection date.

Plant

Plant associated with the specimen.

Col.method

Collection method.

log(Spec.wgt)

Natural logarithm of dry body mass in mg.

log(IT)

Natural logarithm of intertegular distance in mm.

Region:Species

Combined region and species grouping identifier.

Details

The model_training attribute identifies the training data for seven body size models. Stored transformed variables are populated for the corresponding training subsets.

References

Kendall et al. (2019). Pollinator size and its consequences: Robust estimates of body size in pollinating insects. doi:10.1002/ece3.4835.


Combined bee tongue-length training data.

Description

Combined training measurements from Cariveau et al. (2016) and Melin et al. (2019), covering six bee families, including Melittidae.

Usage

data(tongue_dataset)

Format

A data frame with 112 rows and eight columns.

Family

Bee family.

mean_tongue_length_mm

Mean total proboscis length in mm.

IT

Mean intertegular distance in mm.

mean_glossa_length_mm

Mean glossa length in mm.

mean_prementum_length_mm

Mean prementum length in mm.

genus

Bee genus.

species

Bee species.

source

Source publication.

Details

Training data for tonguelength, comprising 101 records from Cariveau et al. (2016) and 11 species means from Melin et al. (2019). The Cariveau data were obtained from the ibartomeus/traitbase repository (raw_data/Cariveau_2016.rda).

References

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.


Converts ITD (mm) to tongue length for bees.

Description

Calculates tongue length (mm) from Cariveau et al. (2016) and Melin et al. (2019) using intertegular distance (ITD) values (mm).

Usage

tonguelength(x, mouthpart = "all")

Arguments

x

A data frame with IT (finite, positive intertegular distance in mm) and Family. Supported families are: "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)

Details

Models are fitted to tongue_dataset, which combines measurements from Cariveau et al. (2016) and Melin et al. (2019). Estimates are back-transformed means with 95 percent confidence intervals, expressed in millimetres. Separate models estimate glossa, prementum and total tongue length.

Value

The input data frame with predicted mouthpart lengths (mm) and 95 percent confidence bounds appended. The glossa-only result is named Glossa.

References

Examples

example=cbind.data.frame(IT=c(1.3,2.3),
                         Family=c("Andrenidae","Apidae"))
tonguelength(example,mouthpart="all")


Converts intertegular distance (mm) to wing loading (mg/mm^2).

Description

Calculates wing loading (mg/mm^2) expressed as dry weight per total wing area using intertegular distance (mm) from Bullock (1999).

Usage

wingloading(IT)

Arguments

IT

A nonempty numeric vector of finite, positive intertegular distances (mm), without missing values.

Value

A numeric vector of wing-loading estimates (mg/mm^2), one per input measurement.

References

Examples

wingloading(IT=c(10,5,2))