BioShiftR: An R package to access, wrangle, and organize the BioShifts database.
BioShifts is a global database of over 31,000 changes in species’ range positions documented in scientific literature, spanning global geographies and taxonomic groups. The database contains documentations of range changes as listed in source publications, as well as standardized calculated rates of change along latitudinal and elevational gradients, and various supplemental data for hypothesis-testing.
BioShifts is a rich resource for studying the effects of climate change on the biogeography of life on Earth, but accessing and manipulating the large and complex database can be daunting.
BioShiftR offers a streamlined and simplified approach for accessing, organizing, and manipulating BioShifts range shift data, with functions for simple collation of raw data, standardized calculated values, associated climate velocities, taxonomy, and more.
Example code:
#-----------------------------------------------------------------------------
# install the package
devtools::install_github("BioShifts/BioShiftR")
library(BioShiftR)
library(dplyr)
# view all range shifts with minimal data columns ============================
get_shifts() %>% glimpse()
#> Rows: 31,759
#> Columns: 13
#> $ id <chr> "A001_P1_ELE_O_M1", "A001_P1_ELE_O_M1", "A001_P1_E…
#> $ article_id <chr> "A001", "A001", "A001", "A001", "A001", "A001", "A…
#> $ poly_id <chr> "P1", "P1", "P1", "P1", "P1", "P1", "P1", "P1", "P…
#> $ method_id <chr> "M01", "M01", "M01", "M01", "M01", "M01", "M01", "…
#> $ eco <chr> "Ter", "Ter", "Ter", "Ter", "Ter", "Ter", "Ter", "…
#> $ type <chr> "ELE", "ELE", "ELE", "ELE", "ELE", "ELE", "ELE", "…
#> $ param <chr> "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", …
#> $ sp_name_publication <chr> "Aegithalos_caudatus", "Certhia_familiaris", "Dend…
#> $ sp_name_checked <chr> "Aegithalos_caudatus", "Certhia_familiaris", "Dend…
#> $ subsp_or_pop <chr> "Giffre Valley", "Giffre Valley", "Giffre Valley",…
#> $ calc_rate <dbl> -2.2128, -0.5106, -7.8723, -3.2340, 4.8511, -1.319…
#> $ calc_unit <chr> "m/year", "m/year", "m/year", "m/year", "m/year", …
#> $ direction <chr> "Lower Elevation", "Lower Elevation", "Lower Eleva…
# filter by taxa, type, or continent: ========================================
get_shifts(group = "Birds",
type = "LAT",
continent = "North America") %>%
glimpse()
#> Rows: 2,382
#> Columns: 13
#> $ id <chr> "A009_P1_LAT_LE_M1", "A009_P1_LAT_LE_M1", "A009_P1…
#> $ article_id <chr> "A009", "A009", "A009", "A009", "A009", "A009", "A…
#> $ poly_id <chr> "P1", "P1", "P1", "P1", "P1", "P1", "P1", "P1", "P…
#> $ method_id <chr> "M01", "M01", "M01", "M01", "M01", "M01", "M01", "…
#> $ eco <chr> "Ter", "Ter", "Ter", "Ter", "Ter", "Ter", "Ter", "…
#> $ type <chr> "LAT", "LAT", "LAT", "LAT", "LAT", "LAT", "LAT", "…
#> $ param <chr> "LE", "LE", "LE", "LE", "LE", "LE", "LE", "LE", "L…
#> $ sp_name_publication <chr> "Accipiter_cooperii", "Accipiter_striatus", "Actit…
#> $ sp_name_checked <chr> "Accipiter_cooperii", "Accipiter_striatus", "Actit…
#> $ subsp_or_pop <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA…
#> $ calc_rate <dbl> 13.78, 0.18, 1.92, 0.51, 0.35, 6.48, 14.71, 0.61, …
#> $ calc_unit <chr> "km/year", "km/year", "km/year", "km/year", "km/ye…
#> $ direction <chr> "Expansion", "Expansion", "Expansion", "Expansion"…
# add additional data columns: ===============================================
get_shifts() %>%
# add methodological attributes
add_methods() %>%
# add values as reported by authors
add_methods() %>%
# add warming trend in the study area
add_trends()
#-----------------------------------------------------------------------------
See more on the package github page.