R: Parse a person to 'cff'

cff_parse_person {cffr} | R Documentation

## Parse a person to `cff`

### Description

Parse a person or string to a valid format for a `CITATION.cff` file. This is a helper function designed to help on adding or replacing the auto-generated authors of the package.

### Usage

    cff_parse_person(person)

    cff_parse_person_bibtex(person)

### Arguments

`person` | A `person` object created with `person()` or a character string. See Details.

### Details

The `person` parameter of the function could be:

- For `cff_parse_person()`: A `person` object or a character coercible to `person`. See `person()` for details.

- For `cff_parse_person_bibtex()`: A string with the definition of an author or several authors, using the standard BibTeX notation. See Markey (2007) for a full explanation.

See Examples for more information.

### Value

A `cff` object ready to be used on `cff_create()`.

### References

- Patashnik, Oren. "BIBTEXTING" February 1988. https://osl.ugr.es/CTAN/biblio/bibtex/base/btxdoc.pdf.

- Markey, Nicolas. "Tame the BeaST." The B to X of BibTeX, Version 1.4 (October 2007). https://osl.ugr.es/CTAN/info/bibtex/tamethebeast/ttb_en.pdf.

### See Also

`cff_create()`, `vignette("cffr", "cffr")`, `utils::person()`

Other parsers: `cff_parse_citation()`

### Examples

    # Parse a person object

    cff_parse_person(person(
      given = "First",
      family = "Author",
      role = c("aut", "cre"),
      email = "first.last@example.com",
      comment = c(
        ORCID = "0000-0001-8457-4658",
        affiliation = "An affiliation"
      )
    ))

    # Parse a string

    cff_parse_person("Julio Iglesias <fake@email.com>")

    # Several persons
    persons <- c(person("Clark", "Kent"), person("Lois", "Lane"))

    cff_parse_person(persons)

    # Or you can use BibTeX style if you prefer

    x <- "Frank Sinatra and Dean Martin and Davis, Jr., Sammy and Joey Bishop"

    cff_parse_person_bibtex(x)

    cff_parse_person_bibtex("Herbert von Karajan")

[Package cffr version 0.2.1 Index]