generate_author_yml: generate_author_yml

View source: R/generate_author_yml.R

generate_author_ymlR Documentation

generate_author_yml

Description

This function helps organize YAML author and affiliation fields such that authorship order can be changed without having to also update the order of affiliations.

Usage

generate_author_yml(
  researchers,
  affiliations,
  corres_name,
  corres_address,
  corres_email
)

Arguments

researchers

a list of named character vectors. Author information is stored in the name of the vector. Abbreviated affiliations are stored in the vector.

affiliations

a list of named character strings. Abbreviated affiliations are stored in the names, the full affiliation is stored in the string.

corres_name

A character string. The name of the corresponding author, must match the author details in the researcher argument identically.

corres_address

A character string. The address of the corresponding author

corres_email

A character string. The email of the corresponding author.

Examples


library(papaja)

generate_author_yml (
 researchers = list(
  "Emma J. Citizen" = c("example_hospital", "example_college"),
  "John H. Smith" = "example_college",
  "Kate C. Jones" = "example_hospital"
   ),
 affiliations = list(
   "example_hospital" = "Southern Example Hospital, NSW, Australia",
   "example_college" = "New Example College, VIC, Australia"
   ),
 corres_name = "Emma J. Citizen",
 corres_address = "123 Example Street, Epping, NSW 2121",
 corres_email = "jane@example.com"
)

papaja documentation built on Sept. 29, 2023, 9:07 a.m.