Closed MichelineCampbell closed 3 years ago
@MichelineCampbell thanks for the question. This is an intended function of the package. For most users of the package, they don't want the final time point returned as a changepoint and so the universal methods to access the slots removes this. However, as a developer there are instances where having the length of the data included is helpful (e.g. in loops and estimating parameters) so this is returned in the cpts
slot. If you want a vector without the length of the data included, the correct function call is cpts(test)
which uses the universal access to slots (regardless of S3/S4/R6 class structure).
Thanks for your question! If you have any more, please post a new issue.
Ahhhhh, I see! Thank-you so much :)
Hi, Thanks for making changepoint a reality - I'm working on incorporating CP analyses into an automated workflow, and have run into a hurdle where the changepoint object returns one more changepoint locations than the list dat@cpts (which I'd like to use to be able to call the locations directly). Do you know if cpt.meanvar will always return the last x value as a changepoint? If so I can just drop the last one off :)
Some test data and what I found below:
returns:
while
returns: