ropensci / rfishbase

R interface to the fishbase.org database
https://docs.ropensci.org/rfishbase
111 stars 40 forks source link

Access climate zone info for each species #174

Closed AudreyLooby closed 4 years ago

AudreyLooby commented 4 years ago

I am hoping to access the climate zone info in rfishbase, but I can't seem to find it in any of the functions. On the species summary page on FishBase, there is a single climate zone listed. For example, Porichthys notatus is listed as "subtropical" (https://www.fishbase.se/summary/Porichthys-notatus) along with a range. I haven't been able to find this data in rfishbase. It seems like something similar is listed in the countrysubref field, but not a single designation for each species like there is on FishBase or like there is for water body type in species() (ie marine v brackish v fresh). I am hoping to divide about 1000 species into different climate zone categories, and it would be more useful to have a straightforward category designation like there is for water body type than something like the FAO regions tables. If anyone knows how to access that data in rfishbase, perhaps even in an older version of the package, please let me know!

cboettig commented 4 years ago

It sounds like you're looking for the ecosystem() function

library(dplyr)
library(rfishbase)

ecosystem("Porichthys notatus") %>% 
  select(Species, EcosystemName, Subtropical, Polar, 
               Boreal, Temperate, Tropical)
# A tibble: 8 x 7
  Species      EcosystemName         Subtropical Polar Boreal Temperate Tropical
  <chr>        <chr>                 <chr>       <chr> <chr>  <chr>     <chr>   
1 Porichthys … Puget Sound           0           0     0      -1        0       
2 Porichthys … Salish Sea            0           0     0      -1        0       
3 Porichthys … Strait of Georgia     0           0     0      -1        0       
4 Porichthys … Pacific Ocean         -1          0     -1     -1        -1      
5 Porichthys … Gulf of Alaska        0           0     -1     0         0       
6 Porichthys … California Current    0           0     0      -1        0       
7 Porichthys … California Current    0           0     0      -1        0       
8 Porichthys … Pacific Central-Amer… 0           0     0      0         -1   

(note the -1 is how FishBase encodes TRUEs). As you can see this species appears to be found in several ecosystems, including some that are designated as subtropical and some that are not

AudreyLooby commented 4 years ago

Okay this is what I had found already. I can try to make it work for me. I guess maybe the FishBase website does something like choose the warmest climate zone for its designation so it only has to list one?

cboettig commented 3 years ago

Ah, apparently this is in the stocks() table.