An R package for changepoint analysis