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.
Arguments
- person
A
person
object created withperson()
or a character string. See Details.
Value
A cff
object ready to be used on cff_create()
.
Details
The person
parameter of the function could be:
For
cff_parse_person()
: Aperson
object or a character coercible toperson
. Seeperson()
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.
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 = "[email protected]",
comment = c(
ORCID = "0000-0001-8457-4658",
affiliation = "An affiliation"
)
))
#> family-names: Author
#> given-names: First
#> email: [email protected]
#> orcid: https://orcid.org/0000-0001-8457-4658
#> affiliation: An affiliation
# Parse a string
cff_parse_person("Julio Iglesias <[email protected]>")
#> family-names: Iglesias
#> given-names: Julio
#> email: [email protected]
# Several persons
persons <- c(person("Clark", "Kent"), person("Lois", "Lane"))
cff_parse_person(persons)
#> - family-names: Kent
#> given-names: Clark
#> - family-names: Lane
#> given-names: Lois
# 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)
#> - family-names: Sinatra
#> given-names: Frank
#> - family-names: Martin
#> given-names: Dean
#> - family-names: Davis
#> given-names: Sammy
#> name-suffix: Jr.
#> - family-names: Bishop
#> given-names: Joey
cff_parse_person_bibtex("Herbert von Karajan")
#> family-names: Karajan
#> given-names: Herbert
#> name-particle: von