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

Is it intended that occ_count() can not take multiple facet arguments like occ_search can? #686

Closed
Andreas-Bio opened this issue Nov 1, 2023 · 1 comment
Labels
Milestone

Comments

@Andreas-Bio
Copy link

Andreas-Bio commented Nov 1, 2023

Is it intended that occ_count() can not take multiple facet arguments like occ_search can?
If I supply with c("","") it says that I need to format as A;B but that gives me an error, too. (see below)

R version 4.3.1 (2023-06-16 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 19045)

Matrix products: default

locale:
[1] LC_COLLATE=German_Germany.utf8 LC_CTYPE=German_Germany.utf8 LC_MONETARY=German_Germany.utf8 LC_NUMERIC=C LC_TIME=German_Germany.utf8

time zone: America/Toronto
tzcode source: internal

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

other attached packages:
[1] microbenchmark_1.4.10 rgbif_3.7.8 Biostrings_2.68.1 GenomeInfoDb_1.36.3 XVector_0.40.0 IRanges_2.34.1 S4Vectors_0.38.1 BiocGenerics_0.46.0
[9] foreach_1.5.2 taxize_0.9.100 BiocManager_1.30.22 xml2_1.3.5 rentrez_1.2.3 magrittr_2.0.3 rstudioapi_0.15.0

loaded via a namespace (and not attached):
[1] gtable_0.3.4 ggplot2_3.4.3 lattice_0.21-8 vctrs_0.6.3 tools_4.3.1 bitops_1.0-7 generics_0.1.3
[8] sandwich_3.0-2 curl_5.0.1 tibble_3.2.1 fansi_1.0.4 pkgconfig_2.0.3 Matrix_1.5-4.1 data.table_1.14.8
[15] uuid_1.1-1 lifecycle_1.0.3 GenomeInfoDbData_1.2.10 stringr_1.5.0 conditionz_0.1.0 compiler_4.3.1 munsell_0.5.0
[22] codetools_0.2-19 RCurl_1.98-1.12 lazyeval_0.2.2 whisker_0.4.1 pillar_1.9.0 crayon_1.5.2 MASS_7.3-60
[29] iterators_1.0.14 multcomp_1.4-25 nlme_3.1-162 tidyselect_1.2.0 digest_0.6.33 mvtnorm_1.2-3 stringi_1.7.12
[36] dplyr_1.1.3 splines_4.3.1 grid_4.3.1 colorspace_2.1-0 cli_3.6.1 triebeard_0.4.1 survival_3.5-5
[43] bold_1.3.0 XML_3.99-0.14 crul_1.4.0 utf8_1.2.3 TH.data_1.1-2 ape_5.7-1 scales_1.2.1
[50] oai_0.4.0 httr_1.4.7 zoo_1.8-12 doParallel_1.0.17 urltools_1.7.3 rlang_1.1.1 Rcpp_1.0.10
[57] glue_1.6.2 httpcode_0.3.0 jsonlite_1.8.7 plyr_1.8.8 R6_2.5.1 zlibbioc_1.46.0

occ_count(taxonKey=c("212;213"), facet=c("country;basisOfRecord"))
Error in occ_count(taxonKey = c("212;213"), facet = c("country;basisOfRecord")) : 
  Bad facet arg.
@jhnwllr
Copy link
Collaborator

jhnwllr commented Nov 1, 2023

@andzandz11 Thanks for pointing this out.

I do not remember if it is intended.

In any case, there should be a better error message, so I will mark it as a bug.

You can always make to multiple calls to occ_count(), or just use occ_search().

I think I sort of intended occ_count() to be a simple wrapper for occ_search(facet="x"), so I am not sure if I will support multiple values (because I am not a big fan of how they work in rgbif in the first place).

@jhnwllr jhnwllr added the Bug label Nov 1, 2023
@jhnwllr jhnwllr added this to the 3.7.9 milestone Nov 24, 2023
jhnwllr pushed a commit that referenced this issue Jan 4, 2024
jhnwllr added a commit that referenced this issue Jan 4, 2024
Co-authored-by: John Waller <ftw712@ku.dk>
@jhnwllr jhnwllr closed this as completed Jan 4, 2024
@jhnwllr jhnwllr mentioned this issue Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants