Open danagrieco opened 1 year ago
Please try updating to the most recent version?
On Thu, Jun 8, 2023 at 6:22 PM Dana I Grieco @.***> wrote:
Hi rfishbase,
I'm having an issue with the validate_names, and I can't seem to figure it out. I ran the code about two weeks ago, and was able to use validate_names with my dataset, and it worked perfectly. Now, before even getting to my dataset, I try to run the simple code, below, to make sure validate names is working, and it produces the following error, below:
validate_names("Abramites ternetzi")
Error in purrr::map_chr(): i In index: 1. Caused by error: ! Result must be length 1, not 2.
Run rlang::last_trace() to see where the error occurred.
rlang::last_trace() <error/purrr_error_indexed>
Backtrace: x
+-rfishbase::validate_names("Abramites ternetzi")
| +-... %>% dplyr::pull(Species)
| -rfishbase::synonyms(...)
| +-... %>% ...
| -rfishbase::fb_tbl("synonyms", server, version, db)
| -rfishbase::fb_import(server, version, db, tbl)
| +-rfishbase:::parse_prov(read_prov(server), version)
| | +-base::withVisible(eval(mc, parent.frame()))
| | -base::eval(mc, parent.frame())
| | -base::eval(mc, parent.frame())
| -rfishbase (local)
(prov = read_prov(server), version = version) | -tibble::tibble(...)
| -tibble:::tibble_quos(xs, .rows, .name_repair)
| -rlang::eval_tidy(xs[[j]], mask)
+-dplyr::pull(., Species)
+-dplyr::left_join(x = tmp, y = ., by = "synonym")
+-dplyr:::left_join.data.frame(x = tmp, y = ., by = "synonym")
| -dplyr::auto_copy(x, y, copy = copy)
| +-dplyr::same_src(x, y)
| -dplyr:::same_src.data.frame(x, y)
| -base::is.data.frame(y)
+-dplyr::distinct(.)
+-dplyr::select(., synonym, Species)
+-dplyr::ungroup(.)
+-dplyr::filter(., !is.na(Species))
+-dplyr::group_by(., synonym)
+-dplyr::mutate(...)
+-dplyr::collect(.)
+-dplyr::select(...)
+-dplyr::mutate(., synonym = paste(SynGenus, SynSpecies))
+-purrr::map_chr(meta, "encodingFormat", .default = NA)
| -purrr:::map_("character", .x, .f, ..., .progress = .progress)
| +-purrr:::with_indexed_errors(...)
| | -base::withCallingHandlers(...)
| -purrr:::call_with_cleanup(...)
-base::.handleSimpleError(...)
-purrr (local) h(simpleError(msg, call))
-cli::cli_abort(...)
-rlang::abort(...)>
— Reply to this email directly, view it on GitHub https://github.com/ropensci/rfishbase/issues/266, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABWK6S6K35A4BUAU73VPMTXKJGBFANCNFSM6AAAAAAY734HYM . You are receiving this because you are subscribed to this thread.Message ID: @.***>
--
Carl Boettiger http://carlboettiger.info/
Hi, I'm also having a problem with validate_names as well. I've updated both the package and R today - I'd last run the code in May and it had worked then. Any advice on the following error appreciated:
validate_names("Abramites ternetzi")
Error in (function (cond) : error in evaluating the argument 'conn' in selecting a method for function 'dbListTables': [UNKNOWN] Failed to stat ':memory:': unknown error
@sollucas sorry but I'm unable to reproduce the behavior you're seeing. Can you try first purging the cache:
rfishbase::db_dir() |> unlink()
Can you please provide more information, including sessionInfo()
output after loading rfishbase?
please ensure related dependencies are up-to-date -- eg. consider using pak::pkg_install("rfishbase", upgrade=TRUE)
.
Thanks for the response - I've tried the suggestions and unfortunately still getting the same error:
rfishbase::db_dir() |> unlink()
Warning message: R graphics engine version 16 is not supported by this version of RStudio. The Plots tab will be disabled until a newer version of RStudio is installed.
library(rfishbase)
sessionInfo()
R version 4.3.1 (2023-06-16 ucrt) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 19044)
Matrix products: default
locale: [1] LC_COLLATE=English_United Kingdom.1252 LC_CTYPE=English_United Kingdom.1252 LC_MONETARY=English_United Kingdom.1252 [4] LC_NUMERIC=C LC_TIME=English_United Kingdom.1252
time zone: Europe/London tzcode source: internal
attached base packages: [1] stats graphics grDevices utils datasets methods base
other attached packages: [1] rfishbase_4.1.2
loaded via a namespace (and not attached): [1] crayon_1.5.2 vctrs_0.6.3 cli_3.6.1 rlang_1.1.1 xfun_0.39 stringi_1.7.12 DBI_1.1.3 purrr_1.0.1
[9] generics_0.1.3 glue_1.6.2 prettyunits_1.1.1 dbplyr_2.3.2 tinytex_0.45 hms_1.1.3 fansi_1.0.4 tibble_3.2.1
[17] tzdb_0.4.0 progress_1.2.2 lifecycle_1.0.3 stringr_1.5.0 compiler_4.3.1 dplyr_1.1.2 fs_1.6.2 pkgconfig_2.0.3
[25] rstudioapi_0.14 R6_2.5.1 readr_2.1.4 tidyselect_1.2.0 utf8_1.2.3 pillar_1.9.0 magrittr_2.0.3 tools_4.3.1
pak::pkg_install("rfishbase", upgrade=TRUE)
✔ Loading metadata database ... done
ℹ No downloads are needed ✔ 1 pkg + 47 deps: kept 48 [27.6s]
library(rfishbase)
validate_names("Abramites ternetzi")
Error in (function (cond) : error in evaluating the argument 'conn' in selecting a method for function 'dbListTables': [UNKNOWN] Failed to stat ':memory:': unknown error
note taht you will need to restart R after installing/upgrade packages. I'm very confused why certain packages are not being listed in your sessionInfo() : in particular, duckdb
is a required package for rfishbase
and I don't see it there....
can you try installing and loading duckdb manually first?
(aside, but is your RStudio version up-to-date as well?)
Updated R Studio today (version 2023.06.0) R version 4.3.1 (2023-06-16 ucrt) -- "Beagle Scouts" Manually installed 2 missing packages: duckdb and contentid. Restarted my laptop after updating/installing the above and have tried restarting R sessions, with the same error appearing:
library(rfishbase)
library(duckdb)
library(contentid)
sessionInfo()
R version 4.3.1 (2023-06-16 ucrt) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 19044)
Matrix products: default
locale: [1] LC_COLLATE=English_United Kingdom.utf8 LC_CTYPE=English_United Kingdom.utf8
[3] LC_MONETARY=English_United Kingdom.utf8 LC_NUMERIC=C
[5] LC_TIME=English_United Kingdom.utf8time zone: Europe/London tzcode source: internal
attached base packages: [1] stats graphics grDevices utils datasets methods base
other attached packages: [1] contentid_0.0.17 duckdb_0.8.1 DBI_1.1.3 rfishbase_4.1.2
loaded via a namespace (and not attached): [1] jsonlite_1.8.5 dplyr_1.1.2 compiler_4.3.1 crayon_1.5.2
[5] tidyselect_1.2.0 stringr_1.5.0 progress_1.2.2 fastmap_1.1.1
[9] readr_2.1.4 R6_2.5.1 generics_0.1.3 curl_5.0.1
[13] tibble_3.2.1 openssl_2.0.6 pillar_1.9.0 tzdb_0.4.0
[17] rlang_1.1.1 utf8_1.2.3 cachem_1.0.8 stringi_1.7.12
[21] fs_1.6.2 memoise_2.0.1 cli_3.6.1 magrittr_2.0.3
[25] rstudioapi_0.14 dbplyr_2.3.2 hms_1.1.3 askpass_1.1
[29] lifecycle_1.0.3 prettyunits_1.1.1 vctrs_0.6.3 glue_1.6.2
[33] fansi_1.0.4 purrr_1.0.1 httr_1.4.6 tools_4.3.1
[37] pkgconfig_2.0.3
validate_names("Abramites ternetzi")
Error in (function (cond) : error in evaluating the argument 'conn' in selecting a method for function 'dbListTables': [UNKNOWN] Failed to stat ':memory:': unknown error
Hi again - I copied my files to a different drive and am no longer getting the error. Apologies, think this was an issue with the original drive I was using. Thanks very much for your help!
Hi rfishbase,
I'm having an issue with the validate_names, and I can't seem to figure it out. I ran the code about two weeks ago, and was able to use validate_names with my dataset, and it worked perfectly. Now, before even getting to my dataset, I try to run the simple code, below, to make sure validate names is working, and it produces the following error, below:
Error in
purrr::map_chr()
: i In index: 1. Caused by error: ! Result must be length 1, not 2.Run
rlang::last_trace()
to see where the error occurred.