rkillick / changepoint

A place for the development version of the changepoint package on CRAN.
127 stars 33 forks source link

`plot` of Changepoint object is not working #51

Closed auzaheta closed 3 years ago

auzaheta commented 3 years ago

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.

rkillick commented 3 years ago

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

auzaheta commented 3 years ago

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.

rkillick commented 3 years ago

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