Exploration of how biodiversity in breeding birds varies in response to environmental variables. Assessment of how species richness (number of speices) varies in response to the mean annual temperature and mean annual precipitation (two bioclim variables).

Your code

Download and import data

For richness data I am using the Breeding Bird Survey of North America data (Sauer et al. 1966). For environmental data I am using mean annual temperature and mean annual precipitation from the worldclim data (Hijmans et al. 2004).

Your code
Your code
##   record_id routedataid countrynum statenum route rpid year  aou count10
## 1         1     6234747        840        2     1  101 1967 2010       0
## 2         2     6234747        840        2     1  101 1967 2020       0
## 3         3     6234747        840        2     1  101 1967 2030       0
## 4         4     6234747        840        2     1  101 1967 2730       0
## 5         5     6234747        840        2     1  101 1967 2890      13
## 6         6     6234747        840        2     1  101 1967 3131       2
##   count20 count30 count40 count50 stoptotal speciestotal
## 1       0       0       2       0         2            2
## 2       0       0       0       1         1            1
## 3       1       0       0       0         1            1
## 4       0       7       1       0         4            8
## 5      12      16       7       4        28           52
## 6       6       0       3       0         5           11
Your code)
##   countrynum statenum route       routename active latitude longitude
## 1        840        2     1      ST FLORIAN      1 34.86869 -87.60414
## 2        840        2     2       HILLSBORO      0 34.63867 -87.19129
## 3        840        2     3        FLORENCE      0 34.80000 -87.73333
## 4        840        2     4           TRADE      1 34.02979 -87.05924
## 5        840        2     5         SUMMITT      0 34.20167 -86.49341
## 6        840        2     6 VALHERMOSO SPGS      0 34.50129 -86.68555
##   stratum bcr routetypeid routetypedetailid
## 1      14  27           1                 1
## 2      14  24           1                 1
## 3      14  24           1                 1
## 4      13  28           1                 1
## 5      13  28           1                 1
## 6      14  24           1                 1
Your code
##   species_id  aou          english_common_name
## 1          6 1770 Black-bellied Whistling-Duck
## 2          7 1780       Fulvous Whistling-Duck
## 3          8 1760                Emperor Goose
## 4          9 1690                   Snow Goose
## 5         10 1691      (Blue Goose) Snow Goose
## 6         11 1700                 Ross's Goose
##             french_common_name           spanish_common_name      sporder
## 1    Dendrocygne à ventre noir        Dendrocygna autumnalis Anseriformes
## 2            Dendrocygne fauve           Dendrocygna bicolor Anseriformes
## 3                 Oie empereur               Anser canagicus Anseriformes
## 4               Oie des neiges            Anser caerulescens Anseriformes
## 5 Oie des neiges (forme bleue) Chen caerulescens (blue form) Anseriformes
## 6                  Oie de Ross                  Anser rossii Anseriformes
##     family       genus                  species
## 1 Anatidae Dendrocygna               autumnalis
## 2 Anatidae Dendrocygna                  bicolor
## 3 Anatidae       Anser                canagicus
## 4 Anatidae       Anser             caerulescens
## 5 Anatidae        Chen caerulescens (blue form)
## 6 Anatidae       Anser                   rossii

Map of Breeding Bird Survey locations

Your code

Map of environmental variables

Your code

Determine species richness for each site

Your code
## Joining, by = c("statenum", "route")
Your code
## # A tibble: 3,251 x 14
## # Groups:   statenum [?]
##    statenum route richness countrynum routename active latitude longitude
##       <int> <int>    <int>      <int> <fct>      <int>    <dbl>     <dbl>
##  1        2     1       70        840 ST FLORI…      1     34.9     -87.6
##  2        2     4       56        840 TRADE          1     34.0     -87.1
##  3        2     7       62        840 SWAIM          1     34.9     -86.2
##  4        2     8       68        840 PINE GRO…      1     34.0     -85.7
##  5        2    10       63        840 MILLERVI…      1     33.2     -85.9
##  6        2    12       55        840 SUNNY EVE      1     33.6     -85.8
##  7        2    14       59        840 SMYER LA…      1     33.5     -86.6
##  8        2    15       51        840 MT OLIVE       1     33.7     -86.9
##  9        2    16       59        840 HOWARD         1     33.8     -87.6
## 10        2    17       55        840 MAYTOWN        1     33.5     -87.0
## # ... with 3,241 more rows, and 6 more variables: stratum <int>,
## #   bcr <int>, routetypeid <int>, routetypedetailid <int>, bio1 <dbl>,
## #   bio12 <dbl>

Visual richness-environment relationships

Your code
## `geom_smooth()` using method = 'gam' and formula 'y ~ s(x, bs = "cs")'