write_ris_df() exports a data frame containing bibliographic information
to a .ris file suitable for EndNote, Zotero, or other reference managers.
This function properly handles multiple authors, keywords, URLs, ISBNs, and
accession numbers. Missing values are automatically converted to empty strings.
Arguments
- df
A data frame containing bibliographic information. Standard columns include:
author— Authors separated by;(e.g.,"Smith, J.; Doe, A.")title— Article or book titleyear— Publication yearjournal— Journal namevolume— Volumenumber— Issue numberpages— Page rangedoi— DOI stringabstract— Abstract textkeywords— Keywords separated by;url— URL or link to articleisbn— ISBN numberaccession_number— Accession numbertype— Reference type (e.g.,"Journal Article")label— Optional labelsource— Database sourcedatabase— Database name
- file
Character. Path to the
.risfile to write.
Value
Invisibly returns the RIS character vector that was written to file. The primary effect is writing the RIS file.
Details
The function ensures that all NA values in the data frame are converted
to empty strings. Multiple authors and keywords are separated using the
specified separators. The resulting RIS file can be imported into EndNote,
Zotero, Mendeley, or other reference managers that support RIS.
Examples
if (FALSE) { # \dontrun{
df <- data.frame(
author = c("Smith, J.; Doe, A.", "Brown, B."),
title = c("Example Paper 1", "Example Paper 2"),
year = c(2020, 2021),
journal = c("Journal A", "Journal B"),
type = c("Journal Article", "Journal Article"),
keywords = c("AI; LLM", "Machine Learning; NLP"),
doi = c("10.1234/example1", "10.1234/example2"),
stringsAsFactors = FALSE
)
write_ris_df(df, file = "example.ris")
} # }