ropensci / bib2df

Parse a BibTeX file to a tibble
https://docs.ropensci.org/bib2df
99 stars 22 forks source link

Allow `bib2df()` to read `.bib` which contains a single entry #18

Closed pegeler closed 6 years ago

pegeler commented 6 years ago

Adjusted bib2df_gather() so that ingesting .bib files with a single entry using bib2df() will not throw error. The code uses mapply(), which simplifies to array/matrix/vector when possible. Therefore, a .bib file with a single entry will return a matrix when a list is expected. Using the SIMPLIFY = FALSE parameter corrects this. The fix was tested and test is included in PR.

codecov-io commented 6 years ago

Codecov Report

Merging #18 into master will increase coverage by 0.27%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #18      +/-   ##
==========================================
+ Coverage    87.9%   88.18%   +0.27%     
==========================================
  Files           6        6              
  Lines         215      220       +5     
==========================================
+ Hits          189      194       +5     
  Misses         26       26
Impacted Files Coverage Δ
R/bib2df_gather.R 96.15% <100%> (+0.19%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 299a066...5851151. Read the comment docs.

ottlngr commented 6 years ago

Thanks for the PR and your effort.