Skip to content

Commit

Permalink
made compatsbile with new rfishbase
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Free committed Nov 15, 2018
1 parent ed223ae commit 67bae41
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions R/resilience.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ resilience <- function(species){
options(FISHBASE_API = "https://fishbase.ropensci.org")
fin_orig <- rfishbase::stocks(spp_fin)
lh_fin <- fin_orig %>%
select(sciname, Resilience) %>%
select(Species, Resilience) %>%
filter(!is.na(Resilience)) %>%
rename(species=sciname, resilience=Resilience) %>%
rename(species=Species, resilience=Resilience) %>%
mutate(resilience=factor(resilience, levels=c("Very low", "Low", "Medium", "High")))

# Calculate mode (default is to resolve ties with lower value)
Expand All @@ -79,9 +79,9 @@ resilience <- function(species){
options(FISHBASE_API = "https://fishbase.ropensci.org/sealifebase")
inv_orig <- rfishbase::stocks(spp_inv)
lh_inv <- inv_orig %>%
select(sciname, Resilience) %>%
select(Species, Resilience) %>%
filter(!is.na(Resilience)) %>%
rename(species=sciname, resilience=Resilience) %>%
rename(species=Species, resilience=Resilience) %>%
mutate(resilience=factor(resilience, levels=c("Very low", "Low", "Medium", "High")))

# Calculate mode (default is to resolve ties with lower value)
Expand Down

0 comments on commit 67bae41

Please sign in to comment.