ropensci / rfishbase

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

Problem with rfishbase fb_tbl() #279

Open martinfriedrichsmanthey opened 3 months ago

martinfriedrichsmanthey commented 3 months ago

Hi all,

I just tried to run an older R script to download trait information from rfishbase. However, the code gives me an error which I don't really understand. Would be great to get some help here.

"specs" is a list of species names from freshwater fish in Germany.

merge results with traits from fishbase.org

specs<-all_specsGermany$species ####get species list specs<-gsub(""," ", specs) #### modify species names tmp<-fb_tbl("species") %>% ##### download traits from fishbase --> there are more traits available, but often duplicated with FE.info or low coverage mutate(sci_name = paste(Genus, Species)) %>% filter(sci_name %in% specs)

And the error:

tmp<-fb_tbl("species") %>% ##### download traits from fishbase --> there are more traits available, but often duplicated with FE.info or low coverage

  • mutate(sci_name = paste(Genus, Species)) %>%
  • filter(sci_name %in% specs) Error in stop_bad_type(): ! Result 1 must be a single string, not a list of length 2 Run rlang::last_trace() to see where the error occurred.

ANy idea how to solve this?

Best, Martin