R/construct_authors.R

Defines functions construct_authors

Documented in construct_authors

#' Construct authors
#' 
#' Helper function to construct an author list for a \emph{DESCRIPTION} file.
#' Returns a template when \code{authors} is not provided (default).
#' @param template Default value to return when \code{authors=NULL}.
#' @inheritParams fill_description
#' @returns Named list in \link[utils]{person} format.
#' 
#' @export
#' @importFrom utils person
#' @examples 
#' authors <- construct_authors()
construct_authors <- function(authors=NULL,
                              template=c( 
  utils::person(
    given = "yourGivenName",
    family = "yourFamilyName",
    role = c("cre"),
    email = "yourEmail@email.com",
    comment = c(ORCID = "yourOrcidId"))
  )
){
  if(is.null(authors)){
    return(template)
  } else {
    return(authors)
  }
}

Try the rworkflows package in your browser

Any scripts or data that you put into this service are public.

rworkflows documentation built on May 29, 2024, 2:37 a.m.