person
Person Names and Contact Information

Description

Utilities to manage person names and contact information

Usage

person(given = NULL, family = NULL, middle = NULL, email = NULL, 
    role = NULL, comment = NULL, first = NULL, last = NULL)
as.person(x)
## Default S3 method:
as.person(x)
## S3 method for class 'person':
x[i]
## S3 method for class 'person':
$(x, name)
## S3 method for class 'person':
as.character(x, ...)
## S3 method for class 'person':
c(..., recursive = FALSE)
## S3 method for class 'person':
format(x, include = c("given", "family", "email", "role", 
    "comment"), braces = list(given = "", family = "", email = c("<", 
    ">"), role = c("[", "]"), comment = c("(", ")")), collapse = list(given = " ", 
    family = " ", email = ", ", role = ", ", comment = ", "), 
    ..., style = c("text", "R"))
## S3 method for class 'person':
print(x, ...)
## S3 method for class 'person':
toBibtex(object, ...)   
personList(...)
as.personList(x)
## S3 method for class 'person':
as.personList(x)
## Default S3 method:
as.personList(x)

Arguments

given a character vector or a list of character strings specifying the given name(s).
family a character vector or a list of character strings specifying the family name(s).
middle a character vector or a list of character strings specifying the middle name(s). Recommended practice is to use given instead of middle. If middle is provided, it is combined with given.
email a character vector or a list of character strings specifying email(s) addresses.
role a character vector or a list of character strings specifying the role(s). The role string must be matched to the role specification: MARC Code List for Relators.
comment a character vector or a list of character strings specifying comment(s). Comment elements named "ORCID" will be converted to links to the ORCID website.
first a character vector or a list of character strings specifying the first name(s). Recommended practice is to use given instead of first. If both given and first are provided, the function stops and displays an error message.
last a character vector or a list of character strings specifying the first name(s). Recommended practice is to use family instead of last. If both family and last are provided, the function stops and displays an error message.
x a character vector or a list of character strings to be coerced to a "person" object for as.person and as.personList(and their S3 methods). A "person" object for all other S3 methods.
i, name see Subscript.
recursive a logical value. If TRUE, indicates that the combining should be done recursively. The default is FALSE.
... "person" objects for c.person and personList, or additional arguments passed to the generic method for the other S3 methods.

include a character vector specifying the fields of the person information to be formatted. By default, the "given", "family", "email", "role" and "comment" fields are formatted.
braces a list of braces pairs specifying the type of braces for each of the fields. By default, the email field is braced with "<" and ">", the role field is braced with "[" and "]", and the comment field is braced with "(" and ")".
collapse a list of collapses specified for each field of the "person" object.

style a character string specifying the format style. "R" means to format a "person" object as R code; otherwise, it is formatted as a normal text string.
object a "person" object.

Details

A "person" object encapsulates the person's information: name(given and family), email address, role, and comment. All of these functions are utilities to manage a person's information: to create a person or a person list, to coerce to a "person" object, to format or to print a "person" object, to subscribe or to combine "person" object(s), and so on.
Value

personreturns an object of class "person" with fields "given", "family", "role", "email" and "comment".
as.personreturns an object of class "person" with fields "given", "family", "role", "email" and "comment".
personListreturns a list of "person" objects.
as.personListreturns a list of "person" objects.
For other S3 methods, see their generic functions for the values.
References
MARC Code List for Relators http://www.loc.gov/marc/relators/relacode.html Washington, DC: Library of Congress Network Development and MARC Standards Office.
See Also
format, paste, as.character, Subscript, toBibtex
Examples

p1 <- person("Tom", "White", email = "tom.white@devel.qaz.com", role = c("aut","cre"), comment = "TERR expert") p1 p1$email

p2 <- as.person("Alfred P. Suit <asuit@hq.qaz.com> [evp] (Exec VP for marketing)") c(p1, p2) c(p1, p2)$role

personList(p1, p2) # Same as c(p1, p2) as.personList(c("Sally Greene <sgreene@dev.qaz.com>", "T. J. Orange [cre]"))

format(c(p1,p2), include = c("family", "given", "role"), braces = list(family = c("", ","), role = c("(Role(s): ", ")")))

format(p1, style = "R")

Package utils version 6.0.0-69
Package Index