readBib {rbibutils}R Documentation

Read and write bibtex files

Description

Read and write bibtex files.

Usage

readBib(file, encoding)

writeBib(object, con = stdout(), append = FALSE)

Arguments

file

name or path to the file, a character string.

encoding

the encoding of file, a character string.

object

a bibentry object.

con

filename (a character string) or a text connection

append

if TRUE append to the file.

Details

readBib is wrapper around bibConvert for import of bibtex files into bibentry objects.

writeBib writes a bibentry object to a bibtex file.

Value

for readBib, a bibentry object

for writeBib, the bibentry object (invisibly)

Author(s)

Georgi N. Boshnakov

See Also

readBibentry and writeBibentry for import/export to R code.

bibConvert

Examples

## create a bibentry object
bibs <- readBib(system.file("REFERENCES.bib", package = "rbibutils"),
                encoding = "UTF-8")
## write bibs to a file
fn <- tempfile(fileext = ".bib")
writeBib(bibs, fn)

## see the contents of the file
readLines(fn) # or: file.show(fn)

unlink(fn)

[Package rbibutils version 2.0 Index]