ropensci / rfishbase

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

Missing species in results #233

Closed bastiensadoul closed 2 years ago

bastiensadoul commented 2 years ago

Hi all,

I am running rfishbase 3.1.9.99 on R version 4.1.1. on windows 64-bit Surprisingly, when I run your example : species(c("Labroides bicolor", "Bolbometopon muricatum"))

Labroides bicolor returns NAs only.

And this is not an isolated problem, with many species also returning NAs. Including species that were working 6 months ago (not sure which version I was using back then).

Am I the only having the problem?

Any hints?

Thank you for your help!

cboettig commented 2 years ago

Can you provide sessionInfo() information?

bastiensadoul commented 2 years ago

Yes, here it is:

sessionInfo() R version 4.1.1 (2021-08-10) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 19043)

Matrix products: default

locale: [1] LC_COLLATE=French_France.1252 LC_CTYPE=French_France.1252 LC_MONETARY=French_France.1252 LC_NUMERIC=C LC_TIME=French_France.1252

attached base packages: [1] stats graphics grDevices utils datasets methods base

other attached packages: [1] rfishbase_3.1.9.99 reshape2_1.4.4 rotl_3.0.11 mgcv_1.8-37 lme4_1.1-27.1 MuMIn_1.43.17 picante_1.8.2 nlme_3.1-153
[9] vegan_2.5-7 lattice_0.20-45 permute_0.9-5 geiger_2.0.7 phytools_0.7-80 maps_3.3.0 MCMCglmm_2.32 ape_5.5
[17] coda_0.19-4 Matrix_1.3-4 devtools_2.4.2 usethis_2.0.1 ggplot2_3.3.5

loaded via a namespace (and not attached): [1] cubature_2.0.4.2 minqa_1.2.4 colorspace_2.0-2 ellipsis_0.3.2 gitcreds_0.1.1 rprojroot_2.0.2
[7] corpcor_1.6.10 fs_1.5.0 rstudioapi_0.13 farver_2.1.0 remotes_2.4.0 gh_1.3.0
[13] fansi_0.5.0 mvtnorm_1.1-2 codetools_0.2-18 splines_4.1.1 mnormt_2.0.2 cachem_1.0.6
[19] pkgload_1.2.2 jsonlite_1.7.2 nloptr_1.2.2.2 cluster_2.1.2 dbplyr_2.1.1 rentrez_1.2.3
[25] readr_2.0.1 compiler_4.1.1 httr_1.4.2 assertthat_0.2.1 fastmap_1.1.0 cli_3.0.1
[31] prettyunits_1.1.1 tools_4.1.1 igraph_1.2.6 gtable_0.3.0 glue_1.4.2 clusterGeneration_1.3.7 [37] dplyr_1.0.7 fastmatch_1.1-3 Rcpp_1.0.7 vctrs_0.3.8 tensorA_0.36.2 stringr_1.4.0
[43] ps_1.6.0 testthat_3.0.4 lifecycle_1.0.0 phangorn_2.7.1 XML_3.99-0.8 MASS_7.3-54
[49] scales_1.1.1 subplex_1.6 hms_1.1.0 parallel_4.1.1 expm_0.999-6 curl_4.3.2
[55] memoise_2.0.0 stringi_1.7.4 desc_1.3.0 plotrix_3.8-2 boot_1.3-28 pkgbuild_1.2.0
[61] rlang_0.4.11 pkgconfig_2.0.3 rncl_0.8.4 purrr_0.3.4 labeling_0.4.2 processx_3.5.2
[67] tidyselect_1.1.1 deSolve_1.29 plyr_1.8.6 magrittr_2.0.1 R6_2.5.1 generics_0.1.0
[73] combinat_0.0-8 DBI_1.1.1 arkdb_0.0.12 pillar_1.6.2 withr_2.4.2 scatterplot3d_0.3-41
[79] tibble_3.1.4 crayon_1.4.1 utf8_1.2.2 tmvnsim_1.0-2 tzdb_0.1.2 progress_1.2.2
[85] grid_4.1.1 callr_3.7.0 digest_0.6.28 numDeriv_2016.8-1.1 stats4_4.1.1 munsell_0.5.0
[91] sessioninfo_1.1.1 quadprog_1.5-8

cboettig commented 2 years ago

thanks.

Can you delete the storage dir:

fs::dir_delete(rfishbase:::db_dir())

restart R, and try again? Please provide the full log of what you see after restarting and running

library(rfishbase)
species()
bastiensadoul commented 2 years ago

Thanks! Deleting the storage dir is not working:

fs::dir_delete(rfishbase::db_dir())
Erreur : 'db_dir' n’est un object exporté depuis 'namespace:rfishbase'

I tried this:

> library(rfishbase)
> ?db_dir
No documentation for ‘db_dir’ in specified packages and libraries:
you could try ‘??db_dir’
> 

After closing R and restarting R, here the results:

R version 4.1.1 (2021-08-10) -- "Kick Things"
Copyright (C) 2021 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)

R est un logiciel libre livré sans AUCUNE GARANTIE.
Vous pouvez le redistribuer sous certaines conditions.
Tapez 'license()' ou 'licence()' pour plus de détails.

R est un projet collaboratif avec de nombreux contributeurs.
Tapez 'contributors()' pour plus d'information et
'citation()' pour la façon de le citer dans les publications.

Tapez 'demo()' pour des démonstrations, 'help()' pour l'aide
en ligne ou 'help.start()' pour obtenir l'aide au format HTML.
Tapez 'q()' pour quitter R.

> library(rfishbase)
> species()
# A tibble: 22,891 x 101
   SpecCode Species                    Genus SpeciesRefNo Author FBname PicPreferredName
   <chr>    <chr>                      <chr>        <dbl> <chr>  <chr>  <chr>           
 1 64588    Aapticheilichthys websteri Aapt~        78622 (Hube~ <NA>   Prweb_u0.jpg    
 2 16239    Aaptosyax grypus           Aapt~        10431 Rainb~ Giant~ Aagry_u0.gif    
 3 2347     Abactochromis labrosus     Abac~        85491 (Trew~ <NA>   Melab_u0.jpg    
 4 62612    Abalistes filamentosus     Abal~        54835 Matsu~ <NA>   Abfil_u0.jpg    
 5 9        Abalistes stellaris        Abal~         9770 (Bloc~ Starr~ Abste_u0.jpg    
 6 58334    Abalistes stellatus        Abal~        11441 (Anon~ <NA>   Abste_u9.jpg    
 7 62797    Abbottina binhi            Abbo~        84795 Nguye~ <NA>   <NA>            
 8 65146    Abbottina lalinensis       Abbo~        81932 Huang~ <NA>   <NA>            
 9 55145    Abbottina liaoningensis    Abbo~        33792 Qin, ~ <NA>   Ablia_u0.jpg    
10 55143    Abbottina obtusirostris    Abbo~        33792 (Wu &~ <NA>   Abobt_u0.jpg    
# ... with 22,881 more rows, and 94 more variables: PicPreferredNameM <chr>,
#   PicPreferredNameF <chr>, PicPreferredNameJ <chr>, FamCode <dbl>,
#   Subfamily <chr>, GenCode <dbl>, SubGenCode <dbl>, BodyShapeI <chr>,
#   Source <chr>, AuthorRef <chr>, Remark <chr>, TaxIssue <dbl>, Fresh <dbl>,
#   Brack <dbl>, Saltwater <dbl>, DemersPelag <chr>, Amphibious <chr>,
#   AmphibiousRef <int>, AnaCat <chr>, MigratRef <dbl>,
#   DepthRangeShallow <chr>, DepthRangeDeep <dbl>, DepthRangeRef <dbl>, ...
cboettig commented 2 years ago

sorry, typo, need three :

fs::dir_delete(rfishbase:::db_dir())
bastiensadoul commented 2 years ago

It works!! Thank you very much!