Skip to contents

Paste and Truncate

Usage

ptrunc(..., width = 40L, sep = ", ", collapse = ", ", dots = " ...")

Arguments

...

one or more R objects, to be converted to character vectors.

width

(maximum) width of result

sep

a character string to separate the terms. Not NA_character_.

collapse

an optional character string to separate the results. Not NA_character_.

dots

character scalar. String to use for ellipses

x

a vector

Value

a character scalar

Examples

  ptrunc(month.abb)
#> [1] "Jan, Feb, Mar, Apr, May, Jun, Jul, A ..."
  ptrunc(month.abb, month.name)
#> [1] "Jan, January, Feb, February, Mar, Ma ..."