| Type: | Package | 
| Title: | Parse a BibTeX File to a Data Frame | 
| Version: | 1.1.2.0 | 
| Description: | Parse a BibTeX file to a data.frame to make it accessible for further analysis and visualization. | 
| URL: | https://docs.ropensci.org/bib2df/, https://github.com/ropensci/bib2df/ | 
| BugReports: | https://github.com/ropensci/bib2df/issues/ | 
| License: | GPL-3 | 
| Imports: | dplyr, stringr, humaniformat, httr | 
| Suggests: | testthat, knitr, rmarkdown, ggplot2, tidyr | 
| RoxygenNote: | 7.3.1 | 
| VignetteBuilder: | knitr | 
| Encoding: | UTF-8 | 
| NeedsCompilation: | no | 
| Packaged: | 2024-05-16 08:45:25 UTC; gianluca | 
| Author: | Philipp Ottolinger [aut], Thomas Leeper [ctb], Maƫlle Salmon [ctb], Paul Egeler [ctb], Emilio Xavier Esposito [ctb], Gianluca Baio [ctb, cre] | 
| Maintainer: | Gianluca Baio <g.baio@ucl.ac.uk> | 
| Repository: | CRAN | 
| Date/Publication: | 2024-05-16 23:00:11 UTC | 
Parse a BibTeX file to a tibble
Description
The BibTeX file is read, parsed, tidied and written to a tibble
Usage
bib2df(file, separate_names = FALSE, merge_lines = FALSE)
Arguments
| file | character, path or URL to a .bib file. | 
| separate_names | logical, should authors' and editors' names be separated into first and given name? | 
| merge_lines | logical, set to  | 
Details
For simplicity bib2df() unifies the reading, parsing and tidying of a BibTeX file while being aware of a standardized output format, different BibTeX styles and missing values in the BibTeX file.
When separate_names = TRUE, the respective columns contain a data.frame for each row. When FALSE, the respective columns contain character strings.
Value
A tibble.
Author(s)
Philipp Ottolinger
See Also
Examples
# Read from .bib file:
path <- system.file("extdata", "bib2df_testfile_3.bib", package = "bib2df")
bib <- bib2df(path)
str(bib)
# Read from .bib file and separate authors' and editors' names:
bib <- bib2df(path, separate_names = TRUE)
str(bib)
Export a BibTeX tibble to a .bib file
Description
The BibTeX tibble is written to a .bib file
Usage
df2bib(x, file = "", append = FALSE, allfields = TRUE)
Arguments
| x | 
 | 
| file | character, file path to write the .bib file. An empty character string writes to  | 
| append | logical, if  | 
| allfields | logical, if  | 
Value
file as a character string, invisibly.
Author(s)
Thomas J. Leeper
Gianluca Baio
References
https://www.bibtex.org/Format/
See Also
Examples
# Read from .bib file:
path <- system.file("extdata", "bib2df_testfile_3.bib", package = "bib2df")
bib <- bib2df(path)
# Write to .bib file:
# bibFile <- tempfile()
# df2bib(bib, bibFile)
# Use `append = TRUE` to add lines to an existing .bib file:
# df2bib(bib, bibFile, append = TRUE)