Title: | Estimate Avian Body Size Distributions |
---|---|
Description: | Generate estimated body size distributions for populations or communities of birds, given either species ID or species' mean body size. Designed to work naturally with the North American Breeding Bird Survey, or with any dataset of bird species, abundance, and/or mean size data. |
Authors: | Renata Diaz [aut, cre] , John Dunning [dtc] |
Maintainer: | Renata Diaz <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.0.0.9000 |
Built: | 2024-10-28 05:52:02 UTC |
Source: | https://github.com/ropensci/birdsize |
For a community (i.e. a collection of populations of different species, or of the same species at different points in time or locations, etc), simulate individual-level size and metabolic rate measurements.
community_generate( community_data_table, abundance_column_name = "speciestotal" )
community_generate( community_data_table, abundance_column_name = "speciestotal" )
community_data_table |
dataframe containing at least one of |
abundance_column_name |
character, the name of the column with species abundances. Defaults to "speciestotal". |
a dataframe one row per individual, all columns from
community_data_table
, and additional columns for species attributes.
Specifically:
AOU
: the AOU, if provided
sim_species_id
: the sim_species_id
if provided
genus
: the genus associated with the AOU if provided, or the genus if provided
species
: the species associated with the AOU if provided, or the species if provided
individual_mass
: the simulated body mass (in grams) for this individual
individual_bmr
: the simulated basal metabolic rate for this individual
mean_size
: the mean body mass for this species (i.e. the parameter used for simulation)
sd_size
: the standard deviation of body mass for this species (i.e. the parameter used for simulation)
abundance
: the number of individuals simulated of this species (i.e. parameter used for simulation)
sd_method
: the method for finding the standard deviation for body mass for this species
scientific_name
: the scientific name
demo_community <- community_generate(demo_route_clean) head(demo_community)
demo_community <- community_generate(demo_route_clean) head(demo_community)
This is the cleaned version of demo_route_raw, a toy dataset for use in vignettes and function testing. It contains all the same column names as would be expected for a Breeding Bird survey route dataset downloaded, e.g. from ScienceBase or the Data Retriever (Pardieck et al. 2019). However, the actual data values are simulated data.
demo_route_clean
demo_route_clean
A data frame with 27 rows and 15 variables:
inherited from data downloaded through the Data Retriever
inherited from Pardieck et al. 2018 (as are all following fields). Unique data identification number.
inherited. Three-digit numerical code for country. In these data, the toy countrynum is 900.
inherited. Two-digit numerical code for state, province, or territory. For these data, the toy number is 99.
inherited. Three-digit code identifying the route, unique within states. For this dataset, 1.
inherited. Three-digit run protocol identifier. Here, set to 101.
inherited. Four-digit year of the survey.
inherited. Five-digit species identification number.
inherited. Total individuals of the species recorded on stops 1-10.
inherited. Total individuals of the species recorded on stops 11-20.
inherited. Total individuals of the species recorded on stops 21-30.
inherited. Total individuals of the species recorded on stops 31-40.
inherited. Total individuals of the species recorded on stops 40-50.
inherited. Total number of stops (of 50), where the species was recorded.
inherited. Total individuals of the species recorded across the entire run of the route (sum of stops).
Nearly all column names are inherited from Pardieck et al. (2019) and are further explained in the Files and Fields Definitions document included as part of the Breeding Bird Survey data release.
The cleaning process removes unidentified species and those poorly sampled by Breeding Bird Survey methods (using the filter_bbs_survey function) and, for these data, filters the year
to 1994
for rapid testing.
Pardieck, K. L., Ziolkowski, D. J., Lutmerding, M., Aponte, V., & Hudson, M.-A. (2019). North American Breeding Bird Survey Dataset 1966—2018, version 2018.0. U.S. Geological Survey. https://doi.org/10.5066/P9HE8XYJ
A toy dataset for use in vignettes and function testing. It contains all the same column names as would be expected for a Breeding Bird survey route dataset downloaded, e.g. from ScienceBase or the Data Retriever (Pardieck et al. 2019). However, the actual data values are simulated data.
demo_route_raw
demo_route_raw
A data frame with 1160 rows and 15 variables:
inherited from data downloaded through the Data Retriever
inherited from Pardieck et al. 2018 (as are all following fields). Unique data identification number.
inherited. Three-digit numerical code for country. In these data, the toy countrynum is 900.
inherited. Two-digit numerical code for state, province, or territory. For these data, the toy number is 99.
inherited. Three-digit code identifying the route, unique within states. For this dataset, 1.
inherited. Three-digit run protocol identifier. Here, set to 101.
inherited. Four-digit year of the survey.
inherited. Five-digit species identification number.
inherited. Total individuals of the species recorded on stops 1-10.
inherited. Total individuals of the species recorded on stops 11-20.
inherited. Total individuals of the species recorded on stops 21-30.
inherited. Total individuals of the species recorded on stops 31-40.
inherited. Total individuals of the species recorded on stops 40-50.
inherited. Total number of stops (of 50), where the species was recorded.
inherited. Total individuals of the species recorded across the entire run of the route (sum of stops).
Nearly all column names are inherited from Pardieck et al. (2019) and are further explained in the Files and Fields Definitions document included as part of the Breeding Bird Survey data release.
Pardieck, K. L., Ziolkowski, D. J., Lutmerding, M., Aponte, V., & Hudson, M.-A. (2019). North American Breeding Bird Survey Dataset 1966—2018, version 2018.0. U.S. Geological Survey. https://doi.org/10.5066/P9HE8XYJ
The raw data for the Breeding Bird Survey includes unidentified species and some species that are not well-sampled by the BBS methods. This function filters a dataframe to remove those species.
filter_bbs_survey(bbs_survey_data)
filter_bbs_survey(bbs_survey_data)
bbs_survey_data |
data frame with columns for species and AOU |
bbs_survey_data with unidentified species, nightbirds, waterbirds, non-targets removed
head(filter_bbs_survey(demo_route_raw))
head(filter_bbs_survey(demo_route_raw))
Given an individual's body mass (in grams), use allometric scaling (Fristoe 2015) to estimate basal metabolic rate.
individual_metabolic_rate(mass)
individual_metabolic_rate(mass)
mass |
mass in grams |
estimated basal metabolic rate
Fristoe, T. S. (2015). Energy use by migrants and residents in North American breeding bird communities. Global Ecology and Biogeography, 24(4), 406–415. https://doi.org/10.1111/geb.12262
individual_metabolic_rate(10)
individual_metabolic_rate(10)
birdsize
A table of the AOU (Pardieck et al 2019), genus, and species of the 443 species with species-specific data built in to birdsize
.
known_species
known_species
A data frame with 443 rows and 6 variables:
AOU used in Paradieck et al. (2019)
genus, from Paradieck et al. (2019)
species, from Paradieck et al. (2019)
Pardieck, K.L., Ziolkowski Jr., D.J., Lutmerding, M., Aponte, V., and Hudson, M-A.R., 2019, North American Breeding Bird Survey Dataset 1966 - 2018 (ver. 2018.0): U.S. Geological Survey, Patuxent Wildlife Research Center, https://doi.org/10.5066/P9HE8XYJ.
Draws body mass measurements for a population of birds (of all the same species) given the population size and either (1) the species AOU or (2) the mean and potentially standard deviation of body mass for that species.
pop_generate( abundance = NA_integer_, AOU = NA_integer_, scientific_name = NA_character_, mean_size = NA_real_, sd_size = NA_real_, sim_species_id = 1 )
pop_generate( abundance = NA_integer_, AOU = NA_integer_, scientific_name = NA_character_, mean_size = NA_real_, sd_size = NA_real_, sim_species_id = 1 )
abundance |
integer number of individuals to draw. Required. |
AOU |
the numeric AOU code used for this species in the Breeding Bird Survey |
scientific_name |
as "Genus species" |
mean_size |
numeric, mean body mass (in grams) for this species. |
sd_size |
numeric, standard deviation of body mass for this species. |
sim_species_id |
defaults AOU or 1 |
abundance
is required, as well as one of: AOU
, scientific_name
, or
mean_size
.
a dataframe with abundance
rows - one record per individual - and
columns for species attributes.
Specifically:
AOU
: the AOU, if provided
sim_species_id
: the sim_species_id
if provided
scientific_name
: the scientific name if provided
individual_mass
: the simulated body mass (in grams) for this individual
individual_bmr
: the simulated basal metabolic rate for this individual
mean_size
: the mean body mass for this species (i.e. the parameter used for simulation)
sd_size
: the standard deviation of body mass for this species (i.e. the parameter used for simulation)
abundance
: the number of individuals simulated of this species (i.e. parameter used for simulation)
sd_method
: the method for finding the standard deviation for body mass for this species
pop_generate(abundance = 5, AOU = 2881) pop_generate(abundance = 5, scientific_name = "Selasphorus calliope") pop_generate(abundance = 5, mean_size = 20, sd_size = 3)
pop_generate(abundance = 5, AOU = 2881) pop_generate(abundance = 5, scientific_name = "Selasphorus calliope") pop_generate(abundance = 5, mean_size = 20, sd_size = 3)
Creates a list with taxonomic/identifying information and parameters for mean and standard deviation of body mass.
species_define( AOU = NA_integer_, scientific_name = NA_character_, mean_size = NA_real_, sd_size = NA_real_, sim_species_id = 1 )
species_define( AOU = NA_integer_, scientific_name = NA_character_, mean_size = NA_real_, sd_size = NA_real_, sim_species_id = 1 )
AOU |
the numeric AOU code used for this species in the Breeding Bird Survey |
scientific_name |
the species' scientific name, as "Genus species" |
mean_size |
mean body size |
sd_size |
sd of body size |
sim_species_id |
identifier; if using taxonomic info, defaults to AOU. If not, defaults to 1. Supplying other values can be useful for simulation models. |
The identifying information used depends on which parameters are provided, with the following order of preference: AOU > scientific name > user provided mean and sd > user provided mean and estimated sd.
list with species parameter information
species_define(AOU = 2881) species_define(scientific_name = "Perdix perdix") species_define(mean_size = 400, sd_size = 30) species_define(mean_size = 400)
species_define(AOU = 2881) species_define(scientific_name = "Perdix perdix") species_define(mean_size = 400, sd_size = 30) species_define(mean_size = 400)
Given either AOU or scientific name, looks up a species' taxonomic information and mean and standard deviation of body size in sd_table.
species_lookup(AOU = NA_integer_, scientific_name = NA_character_)
species_lookup(AOU = NA_integer_, scientific_name = NA_character_)
AOU |
the numeric AOU code used for this species in the Breeding Bird Survey |
scientific_name |
the species' scientific name, as "Genus species" |
data frame with columns AOU, genus, species, mean_mass, mean_sd, contains_estimates, scientific_name
species_lookup(AOU = 2881) species_lookup(scientific_name = "Selasphorus calliope")
species_lookup(AOU = 2881) species_lookup(scientific_name = "Selasphorus calliope")
This data table is a toy data frame for the vignettes. It has abundances and AOU codes for 5 species to make up a hypothetical community.
toy_aou_community
toy_aou_community
A data frame with 5 rows and 2 variables:
AOU
Number of individuals to simulate masses for
This data table is a toy data frame for the vignettes. It has abundances and mean body sizes for 5 species to make up a hypothetical community.
toy_size_community
toy_size_community
A data frame with 5 rows and 3 variables:
Mean mass, in g
Number of individuals to simulate masses for
ID
This data table is a toy data frame for the vignettes. It has abundances and scientific names for 5 species to make up a hypothetical community.
toy_species_name_community
toy_species_name_community
A data frame with 5 rows and 2 variables:
Scientific name
Number of individuals to simulate masses for