crsh / citr

RStudio Addin to Insert Markdown Citations
Other
407 stars 46 forks source link

Error in BibOptions(): could not find function "BibOptions" #60

Closed jooyoungseo closed 4 years ago

jooyoungseo commented 4 years ago

citr::tidy_bib_file() function does not work properly without explicitly loading RefManageR package.

Please see the reproducible code below:

# Download test Rmd and bib files:
utils::download.file("https://jooyoungseo.com/test.Rmd", destfile = "test.Rmd")
utils::download.file("https://jooyoungseo.com/test.bib", destfile = "test.bib")

## Create tidy bib file:
citr::tidy_bib_file(
  rmd_file = "test.Rmd"
  , messy_bibliography = "test.bib"
  , file = "tidy_references.bib"
)
#> Removing 119 unneeded bibliography entries.
#> Error in BibOptions(): could not find function "BibOptions"

# Loading RefManageR
library(RefManageR)

# Create tidy bib file:
citr::tidy_bib_file(
  rmd_file = "test.Rmd"
  , messy_bibliography = "test.bib"
  , file = "tidy_references.bib"
)
#> Removing 119 unneeded bibliography entries.
#> Writing 4 Bibtex entries ... OK
#> Results written to file 'tidy_references.bib'

Created on 2020-01-21 by the reprex package (v0.3.0.9001)

Session info ``` r sessioninfo::session_info() #> - Session info --------------------------------------------------------------- #> setting value #> version R version 3.6.2 (2019-12-12) #> os Windows 10 x64 #> system x86_64, mingw32 #> ui RTerm #> language (EN) #> collate English_United States.1252 #> ctype English_United States.1252 #> tz America/New_York #> date 2020-01-21 #> #> - Packages ------------------------------------------------------------------- #> package * version date lib source #> assertthat 0.2.1 2019-03-21 [2] CRAN (R 3.6.2) #> backports 1.1.5 2019-10-02 [2] CRAN (R 3.6.1) #> bibtex 0.4.2.2 2020-01-02 [2] CRAN (R 3.6.2) #> citr 0.3.2 2020-01-09 [1] Github (crsh/citr@e09de2e) #> cli 2.0.1 2020-01-08 [1] CRAN (R 3.6.2) #> crayon 1.3.4 2017-09-16 [2] CRAN (R 3.6.2) #> digest 0.6.23 2019-11-23 [2] CRAN (R 3.6.2) #> evaluate 0.14 2019-05-28 [2] CRAN (R 3.6.2) #> fansi 0.4.1 2020-01-08 [1] CRAN (R 3.6.2) #> fastmap 1.0.1 2019-10-08 [2] CRAN (R 3.6.2) #> fs 1.3.1 2019-05-06 [2] CRAN (R 3.6.2) #> glue 1.3.1 2019-03-12 [2] CRAN (R 3.6.2) #> highr 0.8 2019-03-20 [2] CRAN (R 3.6.2) #> htmltools 0.4.0.9002 2020-01-17 [1] Github (rstudio/htmltools@e07546c) #> httpuv 1.5.2 2019-09-11 [2] CRAN (R 3.6.2) #> httr 1.4.1 2019-08-05 [2] CRAN (R 3.6.2) #> jsonlite 1.6 2018-12-07 [2] CRAN (R 3.6.2) #> knitr 1.27.2 2020-01-21 [1] Github (yihui/knitr@ab191b0) #> later 1.0.0 2019-10-04 [2] CRAN (R 3.6.2) #> lubridate 1.7.4 2018-04-11 [2] CRAN (R 3.6.2) #> magrittr 1.5 2014-11-22 [2] CRAN (R 3.6.2) #> mime 0.8 2019-12-19 [2] CRAN (R 3.6.2) #> miniUI 0.1.1.1 2018-05-18 [2] CRAN (R 3.6.0) #> pillar 1.4.3 2019-12-20 [2] CRAN (R 3.6.2) #> pkgconfig 2.0.3 2019-09-22 [2] CRAN (R 3.6.2) #> plyr 1.8.5 2019-12-10 [2] CRAN (R 3.6.2) #> promises 1.1.0 2019-10-04 [2] CRAN (R 3.6.2) #> purrr 0.3.3 2019-10-18 [2] CRAN (R 3.6.2) #> R6 2.4.1 2019-11-12 [2] CRAN (R 3.6.2) #> Rcpp 1.0.3 2019-11-08 [2] CRAN (R 3.6.2) #> RefManageR * 1.2.13 2020-01-03 [2] Github (ropensci/RefManageR@be9d663) #> reprex 0.3.0.9001 2020-01-14 [1] Github (tidyverse/reprex@9639e88) #> rlang 0.4.2 2019-11-23 [2] CRAN (R 3.6.2) #> rmarkdown 2.1.1 2020-01-21 [1] Github (rstudio/rmarkdown@18ba267) #> sessioninfo 1.1.1 2018-11-05 [2] CRAN (R 3.6.2) #> shiny 1.4.0.9001 2020-01-16 [1] Github (rstudio/shiny@cdbdb45) #> stringi 1.4.5 2020-01-11 [1] CRAN (R 3.6.2) #> stringr 1.4.0.9000 2020-01-21 [1] Github (hadley/stringr@cc6e322) #> styler 1.2.0 2019-10-17 [2] CRAN (R 3.6.2) #> tibble 2.1.3 2019-06-06 [2] CRAN (R 3.6.2) #> withr 2.1.2 2018-03-15 [2] CRAN (R 3.6.2) #> xfun 0.12.2 2020-01-17 [1] Github (yihui/xfun@9ecdc33) #> xml2 1.2.2 2019-08-09 [2] CRAN (R 3.6.2) #> xtable 1.8-4 2019-04-21 [2] CRAN (R 3.6.2) #> yaml 2.2.0 2018-07-25 [2] CRAN (R 3.6.0) #> #> [1] C:/Users/JooYoung/R/win-library/3.6 #> [2] C:/Program Files/R/R-3.6.2/library ```
crsh commented 4 years ago

I just pushed a commit, that should fix this. When it's convenient for you, let me know if it works.