Skip to contents

A helper function for finding the appropriate species name for use in stratify().

Usage

search_species(species, combine_species_forms = TRUE)

Arguments

species

Character/Numeric. Search term, either name in English or French, AOU code, or scientific genus or species. Matches by regular expression but ignores case.

combine_species_forms

Logical. Whether or not to search the combined species data or the uncombined species. Note that this results in different species names.

Value

Data frame subset of BBS species data frame

Examples


# Search for various terms
search_species("Paridae")
#> # A tibble: 17 × 9
#>      aou english               french spanish order family genus species unid_…¹
#>    <dbl> <chr>                 <chr>  <chr>   <chr> <chr>  <chr> <chr>   <lgl>  
#>  1  7360 Carolina Chickadee    Mésan… Poecil… Pass… Parid… Poec… caroli… TRUE   
#>  2  7350 Black-capped Chickad… Mésan… Poecil… Pass… Parid… Poec… atrica… TRUE   
#>  3  7380 Mountain Chickadee    Mésan… Poecil… Pass… Parid… Poec… gambeli TRUE   
#>  4  7370 Mexican Chickadee     Mésan… Poecil… Pass… Parid… Poec… sclate… TRUE   
#>  5  7410 Chestnut-backed Chic… Mésan… Poecil… Pass… Parid… Poec… rufesc… TRUE   
#>  6  7400 Boreal Chickadee      Mésan… Poecil… Pass… Parid… Poec… hudson… TRUE   
#>  7  7352 unid. Carolina Chick… unid … Poecil… Pass… Parid… Poec… caroli… TRUE   
#>  8  7353 unid. Black-capped C… unid … Poecil… Pass… Parid… Poec… atrica… TRUE   
#>  9  7354 unid. Black-capped C… unid … Poecil… Pass… Parid… Poec… atrica… TRUE   
#> 10  7351 unid. western chicka… unid … Poecil… Pass… Parid… Poec… sp.     TRUE   
#> 11  7340 Bridled Titmouse      Mésan… Baeolo… Pass… Parid… Baeo… wollwe… TRUE   
#> 12  7330 Oak Titmouse          Mésan… Baeolo… Pass… Parid… Baeo… inorna… TRUE   
#> 13  7331 Juniper Titmouse      Mésan… Baeolo… Pass… Parid… Baeo… ridgwa… TRUE   
#> 14  7332 unid. Oak Titmouse /… unid … Baeolo… Pass… Parid… Baeo… inorna… TRUE   
#> 15  7310 Tufted Titmouse       Mésan… Baeolo… Pass… Parid… Baeo… bicolor TRUE   
#> 16  7320 Black-crested Titmou… Mésan… Baeolo… Pass… Parid… Baeo… atricr… TRUE   
#> 17  7315 unid. Tufted Titmous… unid … Baeolo… Pass… Parid… Baeo… bicolo… TRUE   
#> # … with abbreviated variable name ¹​unid_combined
search_species("chickadee")
#> # A tibble: 10 × 9
#>      aou english               french spanish order family genus species unid_…¹
#>    <dbl> <chr>                 <chr>  <chr>   <chr> <chr>  <chr> <chr>   <lgl>  
#>  1  7360 Carolina Chickadee    Mésan… Poecil… Pass… Parid… Poec… caroli… TRUE   
#>  2  7350 Black-capped Chickad… Mésan… Poecil… Pass… Parid… Poec… atrica… TRUE   
#>  3  7380 Mountain Chickadee    Mésan… Poecil… Pass… Parid… Poec… gambeli TRUE   
#>  4  7370 Mexican Chickadee     Mésan… Poecil… Pass… Parid… Poec… sclate… TRUE   
#>  5  7410 Chestnut-backed Chic… Mésan… Poecil… Pass… Parid… Poec… rufesc… TRUE   
#>  6  7400 Boreal Chickadee      Mésan… Poecil… Pass… Parid… Poec… hudson… TRUE   
#>  7  7352 unid. Carolina Chick… unid … Poecil… Pass… Parid… Poec… caroli… TRUE   
#>  8  7353 unid. Black-capped C… unid … Poecil… Pass… Parid… Poec… atrica… TRUE   
#>  9  7354 unid. Black-capped C… unid … Poecil… Pass… Parid… Poec… atrica… TRUE   
#> 10  7351 unid. western chicka… unid … Poecil… Pass… Parid… Poec… sp.     TRUE   
#> # … with abbreviated variable name ¹​unid_combined
search_species("mésang")
#> # A tibble: 19 × 9
#>      aou english               french spanish order family genus species unid_…¹
#>    <dbl> <chr>                 <chr>  <chr>   <chr> <chr>  <chr> <chr>   <lgl>  
#>  1  4840 Canada Jay            Mésan… Periso… Pass… Corvi… Peri… canade… TRUE   
#>  2  7360 Carolina Chickadee    Mésan… Poecil… Pass… Parid… Poec… caroli… TRUE   
#>  3  7350 Black-capped Chickad… Mésan… Poecil… Pass… Parid… Poec… atrica… TRUE   
#>  4  7380 Mountain Chickadee    Mésan… Poecil… Pass… Parid… Poec… gambeli TRUE   
#>  5  7370 Mexican Chickadee     Mésan… Poecil… Pass… Parid… Poec… sclate… TRUE   
#>  6  7410 Chestnut-backed Chic… Mésan… Poecil… Pass… Parid… Poec… rufesc… TRUE   
#>  7  7400 Boreal Chickadee      Mésan… Poecil… Pass… Parid… Poec… hudson… TRUE   
#>  8  7352 unid. Carolina Chick… unid … Poecil… Pass… Parid… Poec… caroli… TRUE   
#>  9  7353 unid. Black-capped C… unid … Poecil… Pass… Parid… Poec… atrica… TRUE   
#> 10  7354 unid. Black-capped C… unid … Poecil… Pass… Parid… Poec… atrica… TRUE   
#> 11  7351 unid. western chicka… unid … Poecil… Pass… Parid… Poec… sp.     TRUE   
#> 12  7340 Bridled Titmouse      Mésan… Baeolo… Pass… Parid… Baeo… wollwe… TRUE   
#> 13  7330 Oak Titmouse          Mésan… Baeolo… Pass… Parid… Baeo… inorna… TRUE   
#> 14  7331 Juniper Titmouse      Mésan… Baeolo… Pass… Parid… Baeo… ridgwa… TRUE   
#> 15  7332 unid. Oak Titmouse /… unid … Baeolo… Pass… Parid… Baeo… inorna… TRUE   
#> 16  7310 Tufted Titmouse       Mésan… Baeolo… Pass… Parid… Baeo… bicolor TRUE   
#> 17  7320 Black-crested Titmou… Mésan… Baeolo… Pass… Parid… Baeo… atricr… TRUE   
#> 18  7315 unid. Tufted Titmous… unid … Baeolo… Pass… Parid… Baeo… bicolo… TRUE   
#> 19  7430 Bushtit               Mésan… Psaltr… Pass… Aegit… Psal… minimus TRUE   
#> # … with abbreviated variable name ¹​unid_combined
search_species("Poecile")
#> # A tibble: 10 × 9
#>      aou english               french spanish order family genus species unid_…¹
#>    <dbl> <chr>                 <chr>  <chr>   <chr> <chr>  <chr> <chr>   <lgl>  
#>  1  7360 Carolina Chickadee    Mésan… Poecil… Pass… Parid… Poec… caroli… TRUE   
#>  2  7350 Black-capped Chickad… Mésan… Poecil… Pass… Parid… Poec… atrica… TRUE   
#>  3  7380 Mountain Chickadee    Mésan… Poecil… Pass… Parid… Poec… gambeli TRUE   
#>  4  7370 Mexican Chickadee     Mésan… Poecil… Pass… Parid… Poec… sclate… TRUE   
#>  5  7410 Chestnut-backed Chic… Mésan… Poecil… Pass… Parid… Poec… rufesc… TRUE   
#>  6  7400 Boreal Chickadee      Mésan… Poecil… Pass… Parid… Poec… hudson… TRUE   
#>  7  7352 unid. Carolina Chick… unid … Poecil… Pass… Parid… Poec… caroli… TRUE   
#>  8  7353 unid. Black-capped C… unid … Poecil… Pass… Parid… Poec… atrica… TRUE   
#>  9  7354 unid. Black-capped C… unid … Poecil… Pass… Parid… Poec… atrica… TRUE   
#> 10  7351 unid. western chicka… unid … Poecil… Pass… Parid… Poec… sp.     TRUE   
#> # … with abbreviated variable name ¹​unid_combined
search_species(7360)
#> # A tibble: 1 × 9
#>     aou english            french     spanish order family genus species unid_…¹
#>   <dbl> <chr>              <chr>      <chr>   <chr> <chr>  <chr> <chr>   <lgl>  
#> 1  7360 Carolina Chickadee Mésange d… Poecil… Pass… Parid… Poec… caroli… TRUE   
#> # … with abbreviated variable name ¹​unid_combined
search_species(73)
#> # A tibble: 28 × 9
#>      aou english               french spanish order family genus species unid_…¹
#>    <dbl> <chr>                 <chr>  <chr>   <chr> <chr>  <chr> <chr>   <lgl>  
#>  1  1730 Brant                 Berna… Branta… Anse… Anati… Bran… bernic… TRUE   
#>  2  2973 Blue Grouse (Dusky/S… Tétra… Dendra… Gall… Phasi… Dend… obscur… TRUE   
#>  3  2730 Killdeer              Pluvi… Charad… Char… Chara… Char… vocife… TRUE   
#>  4   730 Aleutian Tern         Stern… Onycho… Char… Larid… Onyc… aleuti… TRUE   
#>  5  3731 Whiskered Screech-Owl Petit… Megasc… Stri… Strig… Mega… tricho… TRUE   
#>  6  3732 Western Screech-Owl   Petit… Megasc… Stri… Strig… Mega… kennic… TRUE   
#>  7  3730 Eastern Screech-Owl   Petit… Megasc… Stri… Strig… Mega… asio    TRUE   
#>  8  4730 Eurasian Skylark      Aloue… Alauda… Pass… Alaud… Alau… arvens… TRUE   
#>  9  7360 Carolina Chickadee    Mésan… Poecil… Pass… Parid… Poec… caroli… TRUE   
#> 10  7350 Black-capped Chickad… Mésan… Poecil… Pass… Parid… Poec… atrica… TRUE   
#> # … with 18 more rows, and abbreviated variable name ¹​unid_combined
search_species("^73") # Use regex to match aou codes starting with 73
#> # A tibble: 17 × 9
#>      aou english               french spanish order family genus species unid_…¹
#>    <dbl> <chr>                 <chr>  <chr>   <chr> <chr>  <chr> <chr>   <lgl>  
#>  1   730 Aleutian Tern         Stern… Onycho… Char… Larid… Onyc… aleuti… TRUE   
#>  2  7360 Carolina Chickadee    Mésan… Poecil… Pass… Parid… Poec… caroli… TRUE   
#>  3  7350 Black-capped Chickad… Mésan… Poecil… Pass… Parid… Poec… atrica… TRUE   
#>  4  7380 Mountain Chickadee    Mésan… Poecil… Pass… Parid… Poec… gambeli TRUE   
#>  5  7370 Mexican Chickadee     Mésan… Poecil… Pass… Parid… Poec… sclate… TRUE   
#>  6  7352 unid. Carolina Chick… unid … Poecil… Pass… Parid… Poec… caroli… TRUE   
#>  7  7353 unid. Black-capped C… unid … Poecil… Pass… Parid… Poec… atrica… TRUE   
#>  8  7354 unid. Black-capped C… unid … Poecil… Pass… Parid… Poec… atrica… TRUE   
#>  9  7351 unid. western chicka… unid … Poecil… Pass… Parid… Poec… sp.     TRUE   
#> 10  7340 Bridled Titmouse      Mésan… Baeolo… Pass… Parid… Baeo… wollwe… TRUE   
#> 11  7330 Oak Titmouse          Mésan… Baeolo… Pass… Parid… Baeo… inorna… TRUE   
#> 12  7331 Juniper Titmouse      Mésan… Baeolo… Pass… Parid… Baeo… ridgwa… TRUE   
#> 13  7332 unid. Oak Titmouse /… unid … Baeolo… Pass… Parid… Baeo… inorna… TRUE   
#> 14  7310 Tufted Titmouse       Mésan… Baeolo… Pass… Parid… Baeo… bicolor TRUE   
#> 15  7320 Black-crested Titmou… Mésan… Baeolo… Pass… Parid… Baeo… atricr… TRUE   
#> 16  7315 unid. Tufted Titmous… unid … Baeolo… Pass… Parid… Baeo… bicolo… TRUE   
#> 17  7300 Pygmy Nuthatch        Sitte… Sitta … Pass… Sitti… Sitta pygmaea TRUE   
#> # … with abbreviated variable name ¹​unid_combined
search_species("blue grouse")
#> # A tibble: 1 × 9
#>     aou english                french spanish order family genus species unid_…¹
#>   <dbl> <chr>                  <chr>  <chr>   <chr> <chr>  <chr> <chr>   <lgl>  
#> 1  2973 Blue Grouse (Dusky/So… Tétra… Dendra… Gall… Phasi… Dend… obscur… TRUE   
#> # … with abbreviated variable name ¹​unid_combined
search_species("sooty grouse")
#> # A tibble: 2 × 9
#>     aou english                french spanish order family genus species unid_…¹
#>   <dbl> <chr>                  <chr>  <chr>   <chr> <chr>  <chr> <chr>   <lgl>  
#> 1  2971 Sooty Grouse           Tétra… Dendra… Gall… Phasi… Dend… fuligi… TRUE   
#> 2  2973 Blue Grouse (Dusky/So… Tétra… Dendra… Gall… Phasi… Dend… obscur… TRUE   
#> # … with abbreviated variable name ¹​unid_combined

# To combine or not
search_species("blue grouse", combine_species_forms = FALSE)
#> # A tibble: 0 × 9
#> # … with 9 variables: aou <dbl>, english <chr>, french <chr>, spanish <chr>,
#> #   order <chr>, family <chr>, genus <chr>, species <chr>, unid_combined <lgl>
search_species("sooty grouse", combine_species_forms = FALSE)
#> # A tibble: 2 × 9
#>     aou english                french spanish order family genus species unid_…¹
#>   <dbl> <chr>                  <chr>  <chr>   <chr> <chr>  <chr> <chr>   <lgl>  
#> 1  2971 Sooty Grouse           Tétra… Dendra… Gall… Phasi… Dend… fuligi… FALSE  
#> 2  2973 unid. Dusky Grouse / … unid … Dendra… Gall… Phasi… Dend… obscur… FALSE  
#> # … with abbreviated variable name ¹​unid_combined
search_species("northern flicker")
#> # A tibble: 4 × 9
#>     aou english                french spanish order family genus species unid_…¹
#>   <dbl> <chr>                  <chr>  <chr>   <chr> <chr>  <chr> <chr>   <lgl>  
#> 1  4123 Northern Flicker (all… Pic f… Colapt… Pici… Picid… Cola… auratus TRUE   
#> 2  4120 (Yellow-shafted Flick… Pic f… Colapt… Pici… Picid… Cola… auratu… TRUE   
#> 3  4130 (Red-shafted Flicker)… Pic f… Colapt… Pici… Picid… Cola… auratu… TRUE   
#> 4  4125 hybrid Northern Flick… hybri… Colapt… Pici… Picid… Cola… auratu… TRUE   
#> # … with abbreviated variable name ¹​unid_combined
search_species("northern flicker", combine_species_forms = FALSE)
#> # A tibble: 4 × 9
#>     aou english                french spanish order family genus species unid_…¹
#>   <dbl> <chr>                  <chr>  <chr>   <chr> <chr>  <chr> <chr>   <lgl>  
#> 1  4123 (unid. Red/Yellow Sha… Pic f… Colapt… Pici… Picid… Cola… auratus FALSE  
#> 2  4120 (Yellow-shafted Flick… Pic f… Colapt… Pici… Picid… Cola… auratu… FALSE  
#> 3  4130 (Red-shafted Flicker)… Pic f… Colapt… Pici… Picid… Cola… auratu… FALSE  
#> 4  4125 hybrid Northern Flick… hybri… Colapt… Pici… Picid… Cola… auratu… FALSE  
#> # … with abbreviated variable name ¹​unid_combined