inbo / etn

R package to access data from the European Tracking Network
https://inbo.github.io/etn/
MIT License
6 stars 5 forks source link

`download_acoustic_dataset()`: `animal_project_code` is falsely detected as invalid #279

Closed lottepohl closed 1 year ago

lottepohl commented 1 year ago

Hi! When I try to use etn::download_acoustic_dataset() with animal_project_code = "ADST-Shark" I get an error. See below for an example:

library(etn)
library(magrittr)
connection <- etn::connect_to_etn(Sys.getenv("userid"), Sys.getenv("pwd"))

# This throws an error
etn::download_acoustic_dataset(connection = connection, animal_project_code = "ADST-Shark", scientific_name = "Mustelus asterias")
#> Error: Invalid value(s) for animal_project_code argument.
#> Valid inputs are: 2004_gudena, 2010_phd_reubens, 2010_phd_reubens_sync, 2011_loire, 2011_rivierprik, 2011_warnow, 2012_leopoldkanaal, 2013_albertkanaal, 2013_foyle, 2014_demer, 2014_frome, 2014_nene, 2015_albertkanaal_vps_ham, 2015_dijle, 2015_fint, 2015_homarus, 2015_phd_gutmann_roberts, 2015_phd_verhelst_cod, 2015_phd_verhelst_eel, 2016_albertkanaal_vps_ham and others...

# But this works just fine
animals <- etn::get_animals(connection = connection, animal_project_code = "ADST-Shark", scientific_name = "Mustelus asterias")

# animals %>% head() %>% View()

Created on 2023-06-01 with reprex v2.0.2

peterdesmet commented 1 year ago

Thanks for reporting! This looks like a bug regarding not ignoring the case of the animal_project_code that was fixed recently. The example you give works for me. Can you reinstall the package with devtools::install_github("inbo/etn") and try again?

PietrH commented 1 year ago

Hi Lotte, could you send us a your session information? You can get this by running sessionInfo() in the console.

lottepohl commented 1 year ago

Hi Pieter, thanks for coming back to this so quickly! I installed the package again but the same error is thrown. See below for my sessionInfo():

sessionInfo()
#> R version 3.6.3 (2020-02-29)
#> Platform: x86_64-pc-linux-gnu (64-bit)
#> Running under: Ubuntu 16.04.7 LTS
#> 
#> Matrix products: default
#> BLAS:   /usr/lib/libblas/libblas.so.3.6.0
#> LAPACK: /usr/lib/lapack/liblapack.so.3.6.0
#> 
#> locale:
#>  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
#>  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
#>  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
#>  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
#>  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
#> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> loaded via a namespace (and not attached):
#>  [1] withr_2.5.0     digest_0.6.31   lifecycle_1.0.3 magrittr_2.0.3 
#>  [5] reprex_2.0.2    evaluate_0.20   highr_0.9       stringi_1.7.12 
#>  [9] rlang_1.1.1     cli_3.6.1       rstudioapi_0.14 fs_1.6.0       
#> [13] vctrs_0.6.2     rmarkdown_2.10  tools_3.6.3     stringr_1.5.0  
#> [17] glue_1.6.2      xfun_0.36       yaml_2.3.7      fastmap_1.1.1  
#> [21] compiler_3.6.3  htmltools_0.5.5 knitr_1.33

Created on 2023-06-02 with reprex v2.0.2

PietrH commented 1 year ago

No problem, we'll figure this out together :)

I can't see etn in your sessionInfo(), is it possible you didn't have it loaded?

This command should also tell us what version you are using:

packageDescription("etn")

Sorry for the hassle, it's just to make extra sure!

lottepohl commented 1 year ago

Hi Pieter! I loaded the etn-package again and this is my session Info now, together with the package version:

sessionInfo()
#> R version 3.6.3 (2020-02-29)
#> Platform: x86_64-pc-linux-gnu (64-bit)
#> Running under: Ubuntu 16.04.7 LTS
#> 
#> Matrix products: default
#> BLAS:   /usr/lib/libblas/libblas.so.3.6.0
#> LAPACK: /usr/lib/lapack/liblapack.so.3.6.0
#> 
#> locale:
#>  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
#>  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
#>  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
#>  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
#>  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
#> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> loaded via a namespace (and not attached):
#>  [1] withr_2.5.0     digest_0.6.31   lifecycle_1.0.3 magrittr_2.0.3 
#>  [5] reprex_2.0.2    evaluate_0.20   highr_0.9       stringi_1.7.12 
#>  [9] rlang_1.1.1     cli_3.6.1       rstudioapi_0.14 fs_1.6.0       
#> [13] vctrs_0.6.2     rmarkdown_2.10  tools_3.6.3     stringr_1.5.0  
#> [17] glue_1.6.2      xfun_0.36       yaml_2.3.7      fastmap_1.1.1  
#> [21] compiler_3.6.3  htmltools_0.5.5 knitr_1.33

packageDescription("etn")$Version
#> [1] "2.1.0"

Created on 2023-06-02 with reprex v2.0.2

PietrH commented 1 year ago

Hi Lotte, I'm having some trouble replicating the error. Would you be willing to have a look at this together during a virtual meeting? If so, feel free to shoot me an email at pieter.huybrechts@inbo.be

lottepohl commented 1 year ago

Hi Pieter!

I tried it again and restarted the Session, and now it works. Thanks a lot! Best, Lotte

lottepohl commented 1 year ago

So we can close this now, I guess