0

Is there a quick and convenient way to turn a vector of years (e.g. c(2013, 2016, 2017, 2018, 2021, 2022, 2023)) into a string that concatenates sequences of years?

My desired output: "2013, 2016-2018, 2021-2023".

Konrad Rudolph
  • 530,221
  • 131
  • 937
  • 1,214
Rob Hanssen
  • 153
  • 8

0 Answers0