---
title: "cffr: Generate Citation File Format Metadata for R Packages"
subtitle: "JOSS paper"
description: Paper published in the Journal of Open Source Software.
keywords:
  - R
  - cff
  - citation
  - credit
  - metadata
author:
  - name: Diego Hernangómez
    orcid: 0000-0001-8457-4658
    affiliations:
      - Independent Researcher
citation:
  type: article-journal
  container-title: Journal of Open Source Software
  volume: 6
  issue: 67
  page: 3900
  available-date: 2021
  doi: 10.21105/joss.03900
  url: https://doi.org/10.21105/joss.03900
date: 2021-11-08
doi: 10.21105/joss.03900
bibliography: REFERENCES.bib
link-citations: true
vignette: >
  %\VignetteIndexEntry{cffr: Generate Citation File Format Metadata for R Packages}
  %\VignetteEngine{quarto::html}
  %\VignetteEncoding{UTF-8}
---

[![](https://joss.theoj.org/papers/10.21105/joss.03900/status.svg)](https://doi.org/10.21105/joss.03900)

## Summary

The Citation File Format project [@druskat_citation_2021] defines a standardized
format for providing citation metadata for software or datasets in plain text
files that are easy for both humans and machines to read.

This metadata format is being adopted by GitHub as the primary format for its
built-in citation support [@github_about_citation]. Other leading archives for
scientific software, including Zenodo and Zotero [@druskat_stephan_making_2021],
have also included support for `CITATION.cff` files in their GitHub integration.

**cffr** provides utilities to generate and validate these `CITATION.cff` files
automatically for **R** [@R_2021] packages by parsing the `DESCRIPTION` file and
the native **R** citation file. The package also includes utilities and examples
for parsing components such as persons and additional citations, plus several
vignettes that illustrate basic package usage and technical details about the
metadata extraction process.

## Statement of need

Citation of research software in research projects is often omitted
[@salmon2021]. One reason software is not cited is the lack of clear citation
information from package developers.

Some of the main reasons for citing software used in research are:

1.  **Reproducibility**: Software and its versions are important information to
    include in any research project. They help peers understand and reproduce
    the results of a study effectively. Including versions is also crucial for
    recording the context of a manuscript when software changes.
2.  **Developer credit:** In the context of free and open source software
    (FOSS), many of the software developers themselves are also researchers.
    Receiving credit for software development should be no different from the
    credit received in other formats, such as books or articles.

`CITATION.cff` files provide clear citation rules for software. The format is
easy to read by humans and can also be parsed by appropriate software. GitHub's
adoption of this format sends a strong message that research software is worthy
of citation and therefore deserves credit.

**cffr** allows **R** software developers to create `CITATION.cff` files from
metadata already included in the package. It also includes validation tools from
the **jsonvalidate** package [@jsonvalidate2021], which allow developers to
assess the validity of the file created using the latest CFF schema.

## Acknowledgements

I would like to thank [Carl
Boettiger](https://ropensci.org/author/carl-boettiger/), [Maëlle
Salmon](https://ropensci.org/author/ma%C3%ABlle-salmon/) and the [rest of the
contributors](https://github.com/ropensci/codemetar/graphs/contributors) of the
**codemetar** package [@codemetar2021]. This package was the primary inspiration
for developing **cffr** and shares a common goal of increasing awareness of the
efforts of software developers.

I would also like to thank [João Martins](https://zambujo.github.io/) and [Scott
Chamberlain](https://ropensci.org/author/scott-chamberlain/) for thorough
reviews that helped improve the package and documentation and [Emily
Riederer](https://emilyriederer.netlify.app/) for handling the [review
process](https://github.com/ropensci/software-review/issues/463).

## Citation

Hernangómez, D., (2021). cffr: Generate Citation File Format Metadata for R
Packages. Journal of Open Source Software, 6(67), 3900,
<https://doi.org/10.21105/joss.03900>

``` bibtex
@article{hernangomez2021,
  doi = {10.21105/joss.03900},
  url = {https://doi.org/10.21105/joss.03900},
  year = {2021},
  publisher = {The Open Journal},
  volume = {6},
  number = {67},
  pages = {3900},
  author = {Diego Hernangómez},
  title = {cffr: Generate Citation File Format Metadata for R Packages},
  journal = {Journal of Open Source Software}
}
```

## References
