Details on new releases below.
bbsBayes2 is a package for performing hierarchical Bayesian analysis of North American Breeding Bird Survey (BBS) data. 'bbsBayes2' will run a full model analysis for one or more species that you choose, or you can take more control and specify how the data should be stratified, prepared for Stan, or modelled.
bbsBayes2 replaces bbsBayes, with a major shift in functionality. The MCMC backend is now Stan instead of JAGS, the workflow has been streamlined, the syntax has changed, and there are new functions. This vignette should help you get started with the package, and there are three others that should help explain some of the new features, choices, and more advanced uses:
Installation instructions are below.
See the documentation for an overview of how to use bbsBayes2.
In addition, there are four vignettes that will help users get familiar with the package and the new functionality.
-
Stratification vignette The stratification vignette explains the built-in options for spatial stratifications as well as the workflow required to apply a custom stratification.
-
Models vignette The models vignette explains the four built-in models that differ in the way the temporal components are structured, and it also covers the built-in options for error distributions and the differences among the model variants (e.g.,
model_variant = "spatial"). -
Advanced vignette The advanced vignette is helpful for users wanting to take the bbsBayes2 functionality further, including alternate calculations of population trend, customizing the Stan models, adding covariates, and even some experimental functions that allow for k-fold cross-validations to compare among models.
bbsBayes2 can be installed from the bbsBayes R-Universe:
install.packages("bbsBayes2",
repos = c(bbsbayes = 'https://bbsbayes.r-universe.dev',
CRAN = 'https://cloud.r-project.org'))Alternatively you can install directly from our GitHub repository with either the pak (recommended) or remotes packages.
With pak:
install.packages("pak")
pak::pkg_install("bbsBayes/bbsBayes2")
With remotes:
install.packages("remotes")
remotes::install_github("bbsBayes/bbsBayes2")
If you want to install the developmental branch (which often includes additional options and newest updates), you can use the following. NOTE: bbsBayes2 is supported by a small team of committed researchers with limited capacity. The development branch may not be stable.
pak::pkg_install("bbsBayes/bbsBayes2@dev")
- New Stratifications.
-
stratify(by = "bcr",...): Includes the 2025 version of the North American Bird Conservation Regions (BCRs). The changes are primarily in Northern Canada, where the largest northern BCRs have been subdivided into regions that are more similar in scale to the BCRs in the rest of the continent. These new BCRs have replaced the previous BCR stratification (i.e.,stratify(by = "bcr",...)will now use this updated BCR map). For reproducibility, the previous BCR map is still available by callingstratify(by = "bcr_old",...). -
stratify(by = "bbs",...): Intersection of the 2025 updated BCRs with states, provinces, and territories in Canada and the United States. This stratification is conceptually the same asstratify(by = "bbs_usgs",...)but uses the updated BCRs.
- Two new arguments in
stratify()
-
stratify(..., use_map = TRUE), the default is TRUE, where the BBS routes are stratified based on the spatial overlay (sf::st_join()) of the strata polygons and the starting locations of each BBS route. This spatial overlay approach has always been used for custom stratifications, and now is also the default for the standard built-in stratifications. In previous versions, the BCR, province, state, or lat_long information for each BBS route was taken from the columns in the BBS database, so not an explictly spatial process. By settinguse_map = FALSEthis previous approach is still available for the following stratifications"bcr_old", "bbs_cws", "bbs_usgs", "latlong", "prov_state". The new stratifications"bbs" and "bcr"do not allowuse_map = FALSE(will be changed to TRUE with a message), because the full list of new BCRs does not yet exist in the BBS database. -
stratify(..., distance_to_strata), optional numerical value indicating the distance in meters within which routes will be joined to the nearest stratum polygon, if the route start point does not intersect any strata. This argument is particularly useful to ensure that routes with starting locations on or near the coast or shoreline of large lakes are included. These coastal routes may be otherwise excluded due to errors in the spatial information (either the starting point coordinate or the strata map). For example, the map associated with the standard bbs stratification excludes 3,877 surveys on 72 routes when this argument is NULL. All of these 72 routes have starting locations on the coasts. Setting this argument to 4000 (any route within 4 km of at least one polygon) ensures all of these coastal routes are included in the nearest stratum. Users should be cautious of using this argument if the strata map does not represent the full landmass of Canada and the United States. For example using a subset of an existing strata map, such as all of the bbs strata within one country will treat routes within the set distance of the national border (e.g., some routes in the US as if they are in Canada) the same way it treats routes that happen to fall just off the coast of the supplied strata map.
Released on December 12, 2025, version 1.1.3 will fetch by default, the 2025 data release (fetch_bbs_data(release = 2025)). The 2025 release includes access to the BBS observations from the 2024 field season. Previous releases are (as always) available by calling them specifically with the release argument in the functions fetch_bbs_data(release = 2024) or stratify(release = 2020).
The new version includes a number of bug fixes, as well as the following new features:
-
first-difference models (hierarchical and spatial) now better handle the missing data from 2020. The models estimate a single value of change (i.e., the difference between 2021 and 2019) and then use random draws from a beta distribution (beta(1,1)) for each posterior draw to randomly partition the difference between the first interval (2019-2020) and the second (2020-2021). This has the result of forcing the mean trajectory to follow a straight line between 2019 and 2021, while increasing the uncertainty of the estimated index for 2020.
-
the
fetch_bbs_data()function now allows the user to retain the BBS observations that do not conform to the survey design. The documentation includes warnings about how this is probably a bad idea. Some additional columns are now included in the$routesobject of the list returned byload_bbs_data()to help understand these additional unacceptable data. The columnsroute_type_id, (RouteTypeID),route_type_detail_id(RouteTypeDetailID),rpid(RPID), andrun_type(RunType) are explained in the release metadata -
all models can now generate prior predictions using
prepare_model(..., use_likelihood = FALSE). This should be particularly useful for applications with a custom model. -
the function
plot_map(..., col_ebird = TRUE, alternate_column = "percent_change")will plot the estimated percent change values using the same categories and colour scheme used by the eBird status and trend team. -
the function
generate_trends(..., export_full_posterior = TRUE)will now add a tibble to the output list that includes the full posterior distribution of every trend estimate. Allows for formal tests/estimates of the differences between two trends (e.g., between two time-periods or two regions).
We hope you'll agree that the BBS is a spectacular dataset. Generations of committed and expert birders have contributed their time and expertise to carefully keeping track of local bird populations. For many BBS observers, it's been a commitment that has lasted 20, 30, or even 40 years! Many federal, state, and provincial government agencies, as well as local and national conservation organizations have supported the coordination and curation of almost 60-years of data.
The BBS was started at the dawn of the modern North American conservation movement, inspired by changes in bird populations noticed by biologists, naturalists, farmers, and other stewards of the natural world. A continental-scale survey of birds, carefully designed to quantify changes in populations through time, in hopes that Rachel Carson's "Silent Spring", would never come to pass.
bbsBayes2 was created: to help researchers make use of these precious data; to better understand the spatial and temporal changes in bird populations; to make agency-derived estimates of population status more transparent; and to inspire improvements, elaborations, and critical feedback on the models provided here. We hope you enjoy the package and we hope you will contribute your ideas and code to this open software initiative.
In versions 1.1.0, 1.1.1, and 1.1.2.0, the non-hierarchical variant of the first-difference model included a coding error. Estimates of trends and population trajectories from this model in these versions will be biased.
The error was fixed in version 1.1.2.1. I am so sorry folks, please reach out if you would like more information or assistance in fixing/recovering from this.
