Skip to contents

Convert Integer Vectors To String

Usage

deparse_svec(
  nums,
  connect = "-",
  concatenate = TRUE,
  collapse = ",",
  max_lag = 1
)

Arguments

nums

integer vector

connect

character used to connect consecutive numbers

concatenate

connect strings if there are multiples

collapse

if concatenate, character used to connect strings

max_lag

defines "consecutive", min = 1

Value

strings representing the input vector. For example, c(1, 2, 3) returns "1-3".

See also

Examples

deparse_svec(c(1:10, 15:18))
#> [1] "1-10,15-18"