## Create a person object directly ...
p1 <- person("Karl", "Pearson", email = "pearson@stats.heaven")
## ... or convert a string.
p2 <- as.person("Ronald Aylmer Fisher")
## Combining and subsetting.
p <- c(p1, p2)
p[1]
p[-1]
## Extracting fields.
p$family
p$email
p[1]$email
## Specifying package authors, example from "boot":
## AC is the first author [aut] who wrote the S original.
## BR is the second author [aut], who translated the code to R [trl],
## and maintains the package [cre].
b <- c(person("Angelo", "Canty", role = "aut", comment =
"S original, http://statwww.epfl.ch/davison/BMA/library.html"),
person(c("Brian", "D."), "Ripley", role = c("aut", "trl", "cre"),
comment = "R port", email = "ripley@stats.ox.ac.uk")
)
b
## Formatting.
format(b)
format(b, include = c("family", "given", "role"),
braces = list(family = c("", ","), role = c("(Role(s): ", ")")))
## Conversion to BibTeX author field.
paste(format(b, include = c("given", "family")), collapse = " and ")
toBibtex(b)
Run the code above in your browser using DataLab