Parses BibTeX, the format Google Scholar, Zotero, Mendeley and most journal
pages export, into sframe_reference() records. Covers the common entry types
(@article, @book, @incollection, @inbook, @inproceedings,
@techreport, @phdthesis, @mastersthesis, @misc, @online,
@software, @dataset, @unpublished) and the common fields. Accented
letters written as LaTeX commands are converted. Base R alone.
Arguments
- file
Path to a
.bibfile.- text
BibTeX as a character string, used instead of
file, for example an entry pasted from Google Scholar.- cited_by
Optional
cited_bytargets given to every entry read, seesframe_reference().
Value
A list of sf_reference objects, named by citation key. An entry
that fails to parse is skipped with a warning naming it. A key used by
more than one entry is an error that names every repeated key. Entries may
be written @article{key, ...} or @article(key, ...).
See also
Other References functions:
sframe_add_references(),
sframe_bibliography(),
sframe_get_references(),
sframe_reference()
Examples
refs <- read_bibtex(text = "@article{cronbach_1951,
author = {Cronbach, Lee J.},
title = {Coefficient alpha and the internal structure of tests},
journal = {Psychometrika},
year = {1951},
volume = {16},
number = {3},
pages = {297--334}
}")
names(refs)