rkillick/changepoint

`plot` of Changepoint object is not working

Closed this issue · 3 comments

I'm working with version 2.2.2 from CRAN and version 2.3.1 from GitHub. For both, the plot functionality is not working.

# change in mean
y=c(rnorm(100,0,1),rnorm(100,5,1))
ansmean=cpt.mean(y)
plot(ansmean,cpt.col='blue')

Error in as.double(y) : 
  cannot coerce type 'S4' to vector of type 'double'

Thanks for a great job with the package.

This works for me in both versions (just copied your code directly). Was the changepoint package the last one loaded in your workspace as sometimes other packages can conflict?
I get this image:
image

My fault, I checked just loading changepoint and it works. However, when I load a package that I'm developing it creates the conflict. Thanks a lot for the hint and I'm so sorry for the false alarm.

No problem, as you may have guessed, I've had the same issue before hence the suggestion to check!