R/display_list.R

#' @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]))
} 
YTLogos/ggthemr documentation built on May 7, 2019, 10:37 a.m.