fix_contributor: Format contributor list into citation-friendly string

View source: R/fix_contributor.R

fix_contributorR Documentation

Format contributor list into citation-friendly string

Description

Given a list of contributors (utils::person objects), this function formats them into a LaTeX/BibLaTeX-compatible string, merging roles per person and formatting names.

Contributors without explicit roles are assumed to have the role "ctb". If the input is NULL or the special string ":unas", the function returns ":unas".

This formatting is intended for metadata serialization or citation exports.

Usage

fix_contributor(contributors = NULL)

Arguments

contributors

A vector of person objects, or the character string ":unas", or NULL.

Value

A character string like ⁠{Jane Doe [dtm, ctb]} and {John Smith [ctb]}⁠.

Examples

## Not run: 
fix_contributor(person("Jane", "Doe", role = c("dtm", "ctb")))
fix_contributor(c(
  person("Jane", "Doe", role = "ctb"),
  person("John", "Smith")
))
fix_contributor(":unas")

## End(Not run)

dataset documentation built on June 8, 2025, 10:15 a.m.