mitchelloharawild / vitae

R Markdown Résumés and CVs
https://pkg.mitchelloharawild.com/vitae/
1.19k stars 229 forks source link

bibliography_entries: Error: Can't subset columns that don't exist. #174

Closed tormodb closed 3 years ago

tormodb commented 3 years ago

After recently updated my r-packages, previous running code is no longer working. When I try to read a .bib file containing references, the following error occurs:

# bibliography_entries("file.bib")
# Error: Can't subset columns that don't exist.
# x Column `other-ids` doesn't exist.

rlang::last_error() <error/vctrs_error_subscript_oob> Can't subset columns that don't exist. x Column other-ids doesn't exist. Backtrace:

  1. vitae::bibliography_entries("file.bib")
  2. tibble:::[.tbl_df(csl_fields, unique(vec_c(!!!lapply(bib, names))))
  3. tibble:::vectbl_as_col_location(...)
  4. vctrs::vec_as_location(j, n, names)
  5. vctrs:::stop_subscript_oob(...)
  6. vctrs:::stop_subscript(...) Run rlang::last_trace() to see the full context.
mitchelloharawild commented 3 years ago

Could you provide a sample of file.bib which produces this error?

tormodb commented 3 years ago

Hi, I sure can and have attached it to this message.

For now, I was able to replace the function with ReadBib from RefManageR which seems to work fine after conversion to tibble.

Hilsen Tormod On 23 Jun 2021, 06:27 +0200, mitchelloharawild @.***>, wrote:

Could you provide a sample of file.bib which produces this error? — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

mitchelloharawild commented 3 years ago

I think you'll have to attach it using the GitHub website, email attachments don't come through.

tormodb commented 3 years ago

Sorry. I was not able to upload *.bib files to GitHub (not supported) so I had to rename the extension before uploading. If you revert it back to file.bib it should work.

file.txt

mitchelloharawild commented 3 years ago

Thanks for your reprex, the 'other-ids' field (produced from some of your entries having the 'ids' entry) was not part of the expected schema in vitae. I've added a fallback to character vectors for these fields.