R/display_list.R

Defines functions display_list

#' @importFrom utils head
display_list <- function(x, last = 'and') {
  n <- length(x)
  if (n == 1) return (x)
  else return (paste(paste(head(x, -1), collapse = ', '), last, x[n]))
} 
cttobin/ggthemr documentation built on April 19, 2022, 3:31 a.m.