Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot execute estimate function #265

Open
charles-patrick-lavin opened this issue Jun 2, 2023 · 3 comments
Open

cannot execute estimate function #265

charles-patrick-lavin opened this issue Jun 2, 2023 · 3 comments

Comments

@charles-patrick-lavin
Copy link

Hello all - I have utilised the estimate function for over a year now.

As of today, I am unable to perform the estimate function, receiving the following error:

code

SAU_FB <- rfishbase::estimate(species_list = SAU_final_spp$scientific_name)

Error in purrr::map_chr():
ℹ 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>
Error in purrr::map_chr():
ℹ In index: 1.
Caused by error:
! Result must be length 1, not 2.


Backtrace:

  1. ├─rfishbase::estimate(species_list = SAU_final_spp$scientific_name)
  2. │ ├─fb_tbl(endpt, server, version, db) %>% fix_ids()
  3. │ └─rfishbase::fb_tbl(endpt, server, version, db)
  4. │ └─rfishbase::fb_import(server, version, db, tbl)
  5. │ ├─rfishbase:::parse_prov(read_prov(server), version)
  6. │ │ ├─base::withVisible(eval(mc, parent.frame()))
  7. │ │ └─base::eval(mc, parent.frame())
  8. │ │ └─base::eval(mc, parent.frame())
  9. │ └─rfishbase (local) <fn>(prov = read_prov(server), version = version)
  10. │ └─tibble::tibble(...)
  11. │ └─tibble:::tibble_quos(xs, .rows, .name_repair)
  12. │ └─rlang::eval_tidy(xs[[j]], mask)
  13. ├─rfishbase:::fix_ids(.)
  14. │ ├─"Speccode" %in% colnames(full_data)
  15. │ └─base::colnames(full_data)
  16. │ └─base::is.data.frame(x)
  17. └─purrr::map_chr(meta, "encodingFormat", .default = NA)
  18. └─purrr:::map_("character", .x, .f, ..., .progress = .progress)
  19. ├─purrr:::with_indexed_errors(...)
    
  20. │ └─base::withCallingHandlers(...)
    
  21. └─purrr:::call_with_cleanup(...)
    

Run rlang::last_trace(drop = FALSE) to see 4 hidden frames.

here is the sessionInfo

sessionInfo()
R version 4.2.2 (2022-10-31 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19045)

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.utf8

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

other attached packages:
[1] factoextra_1.0.7 FactoMineR_2.4 segmented_1.6-0 nlme_3.1-160 MASS_7.3-58.1 ggpmisc_0.5.0
[7] ggpp_0.4.5 ggpubr_0.4.0 corrplot_0.92 worrms_0.4.2 rfishbase_4.1.1 caTools_1.18.2
[13] car_3.1-0 carData_3.0-5 data.table_1.14.2 plyr_1.8.8 forcats_0.5.1 stringr_1.4.0
[19] dplyr_1.0.9 readr_2.1.2 tidyr_1.2.0 tibble_3.1.7 ggplot2_3.4.1 tidyverse_1.3.1
[25] purrr_1.0.1

loaded via a namespace (and not attached):
[1] bitops_1.0-7 fs_1.5.2 lubridate_1.9.2 progress_1.2.2 httr_1.4.5
[6] tools_4.2.2 backports_1.4.1 utf8_1.2.2 R6_2.5.1 DT_0.23
[11] DBI_1.1.3 colorspace_2.0-3 withr_2.5.0 tidyselect_1.2.0 prettyunits_1.1.1
[16] compiler_4.2.2 cli_3.6.1 rvest_1.0.2 quantreg_5.93 flashClust_1.01-2
[21] SparseM_1.81 xml2_1.3.3 scales_1.2.1 digest_0.6.29 pkgconfig_2.0.3
[26] htmltools_0.5.4 dbplyr_2.2.1 fastmap_1.1.0 htmlwidgets_1.5.4 rlang_1.1.0
[31] readxl_1.4.0 rstudioapi_0.14 generics_0.1.3 jsonlite_1.8.2 magrittr_2.0.3
[36] leaps_3.1 Matrix_1.5-1 Rcpp_1.0.10 munsell_0.5.0 fansi_1.0.3
[41] abind_1.4-5 lifecycle_1.0.3 scatterplot3d_0.3-41 stringi_1.7.6 grid_4.2.2
[46] ggrepel_0.9.1 crayon_1.5.1 lattice_0.20-45 haven_2.5.0 splines_4.2.2
[51] hms_1.1.1 pillar_1.8.1 ggsignif_0.6.3 reprex_2.0.1 glue_1.6.2
[56] modelr_0.1.8 vctrs_0.5.0 tzdb_0.3.0 MatrixModels_0.5-0 cellranger_1.1.0
[61] gtable_0.3.2 assertthat_0.2.1 cachem_1.0.6 broom_0.8.0 rstatix_0.7.0
[66] survival_3.4-0 memoise_2.0.1 cluster_2.1.4 timechange_0.2.0 ellipsis_0.3.2

Does anyone know how I can address this?
Many thanks for your time.

@cboettig
Copy link
Member

cboettig commented Jun 2, 2023

apologies, we're in the middle of the new deploy and waiting for the next version to hit CRAN. can you try:

remotes::install_github("ropensci/rfishbase")

restart R and try again?

Thanks for the bug report!

@Nicolescm
Copy link

Nicolescm commented Jun 2, 2023

apologies, we're in the middle of the new deploy and waiting for the next version to hit CRAN. can you try:

remotes::install_github("ropensci/rfishbase")

restart R and try again?

Thanks for the bug report!

I had the same issue, but the reinstallation worked! Thanks

@charles-patrick-lavin
Copy link
Author

Thank you all for your rapid response. Everything is working after reinstallation. Also many thanks for wonderful rfishbase!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants