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:

See Examples for more information.

Value

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

References

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.0 Index]