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"
.
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"
.