AffStyle: Automatic generation of author list with customized styles.

Description Usage Arguments Details Value Examples

View source: R/AffStyle.R

Description

AffStyle facilitates the generation of long author list in different styles based on the requirements of research journals.

Usage

1
AffStyle(X, first, last, middle, name, degree, index, template)

Arguments

X

A user-supplied data frame with columns containing the authors' affiliations.

first

Name of the variable containing the authors' first names. See 'Examples'.

last

Name of the variable containing the authors' last names. See 'Examples'.

middle

Name of the variable containing the authors' middle names. See 'Examples'.

name

Name of the variable containing the authors' full names. See 'Examples'.

degree

Name of the variable containing the authors' title (PhD, MS, etc..). See 'Examples'.

index

index acquired from AutoAff function. See 'Value' in AutoAff.

template

A template indicating the style of output. See 'Details' and 'Examples'.

Details

template represents a style specified by the user.

f: first name

m: middle name

l: last name

n: full name

d: degree

i: index (acquired by AutoAff)

^foo^: if 'foo' needs to be superscripted

Any other characters can be used based on the user's need. For example, spaces can be added between first and last names, colons ';' can be added at the end as separators.

Styles that include superscripts/subscripts require the use of R Markdown. The output for these styles are R Markdown syntax (text between ^^ will be superscipts after knitting).

Value

The function returns a text string that is either ready to be pasted into your manuscript (without superscripts) or need to be copied to R Markdown and knitted (with superscripts).

Examples

1
2
3
4
5
result <- AutoAff(X = authors,
                  affiliation = c("aff1", "aff2", "aff3", "aff4", "aff5", "aff6"))#' 
template <- "f m l, d^i^;"
AffStyle(X = authors, first = "First", middle = "Middle", last = "Last",
         degree = "Degree", index = result$index, template = template)

ly129/AutoAff documentation built on Nov. 4, 2019, 5:16 p.m.