index: Index of times, typically returned by stats::time()
cpts: Time series observation labels to be converted to indices
Returns
tau2time(): a character of time labels
time2tau(): an integer vector of changepoint indices
Examples
# Recover the years from a set of changepoint indicestau2time(c(42,81,330), index = as_year(time(CET)))# Recover the changepoint set indices from the yearstime2tau(c(1700,1739,1988), index = as_year(time(CET)))