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

Problem getting list of publications for a given TSN #20

Closed
maurobio opened this issue Jan 30, 2021 · 4 comments
Closed

Problem getting list of publications for a given TSN #20

maurobio opened this issue Jan 30, 2021 · 4 comments
Milestone

Comments

@maurobio
Copy link

maurobio commented Jan 30, 2021

I have the code below:

library(ritis) # load package
result <- search_scientific(("Vicia faba"))  # search TSN for a scientific name
tsn <- as.integer(result["tsn"]) # get TSN as an integer
pubs <- publications(tsn) # try to get a list of publications for the TSN

But get the error:

Error: $ operator is invalid for atomic vectors

Any hints?

Session Info
R version 4.0.3 (2020-10-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17134)

Matrix products: default

locale:
[1] LC_COLLATE=Portuguese_Brazil.1252  LC_CTYPE=Portuguese_Brazil.1252   
[3] LC_MONETARY=Portuguese_Brazil.1252 LC_NUMERIC=C                      
[5] LC_TIME=Portuguese_Brazil.1252    

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

other attached packages:
[1] devtools_2.3.2 usethis_2.0.0  ritis_0.9.0   

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.6        pillar_1.4.7      compiler_4.0.3    plyr_1.8.6        remotes_2.2.0    
 [6] prettyunits_1.1.1 tools_4.0.3       testthat_3.0.1    pkgload_1.1.0     pkgbuild_1.2.0   
[11] jsonlite_1.7.2    memoise_2.0.0     lifecycle_0.2.0   tibble_3.0.5      pkgconfig_2.0.3  
[16] rlang_0.4.10      DBI_1.1.1         cli_2.2.0         rstudioapi_0.13   crul_1.0.0       
[21] curl_4.3          fastmap_1.1.0     withr_2.4.1       dplyr_1.0.3       xml2_1.3.2       
[26] desc_1.2.0        generics_0.1.0    vctrs_0.3.6       fs_1.5.0          rprojroot_2.0.2  
[31] triebeard_0.3.0   tidyselect_1.1.0  glue_1.4.2        httpcode_0.3.0    data.table_1.13.6
[36] R6_2.5.0          processx_3.4.5    fansi_0.4.2       solrium_1.1.4     sessioninfo_1.1.1
[41] callr_3.5.1       purrr_0.3.4       magrittr_2.0.1    ps_1.5.0          urltools_1.7.3   
[46] ellipsis_0.3.1    assertthat_0.2.1  utf8_1.1.4        cachem_1.0.1      crayon_1.3.4     
@sckott
Copy link
Contributor

sckott commented Feb 1, 2021

i can't replicate the issue. try that again and then run traceback() and share that output

@maurobio
Copy link
Author

maurobio commented Feb 1, 2021

After repeating the sequence of commands:

result <- search_scientific(("Vicia faba"))
tsn <- as.integer(result["tsn"])
pubs <- publications(tsn)

I still get the error message:

Error: $ operator is invalid for atomic vectors

Here are the traceback() results:

6: data.table::rbindlist(x, use.names = TRUE, fill = TRUE)
5: data.table::setDF(data.table::rbindlist(x, use.names = TRUE, 
       fill = TRUE))
4: bindlist(x$referenceFor)
3: dr_op(bindlist(x$referenceFor), "class")
2: cbind(dr_op(x, "referencefor"), dr_op(bindlist(x$referenceFor), 
       "class"))
1: publications(tsn)

@sckott sckott added this to the v1.0 milestone Feb 1, 2021
@sckott
Copy link
Contributor

sckott commented Feb 1, 2021

sorted back in Sep 2020 i think - see #19 - try again after reinstalling like remotes::install_github("ropensci/ritis")

@maurobio
Copy link
Author

maurobio commented Feb 1, 2021

I reinstalled the package using devtools::install_github("ropensci/ritis") and it now works fine!

Unfortunately, the version from CRAN is not up-to-date.

Thanks a lot!

@maurobio maurobio closed this as completed Feb 1, 2021
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

2 participants