bcp (change point) package not working, R not responding. Can you help me finding the issue?

Dear all,

I am trying to use bcp() function in the following package:

Unfortunately, every time I run it, regardless of how big or small my data are, R freezes and doesn't respond. I left it on for 1 hour but nothing has changed.
Could you please let me know if you get the same issue, if it's just me (or my environment), or if there is a way to fix it?

Regards,

Simone

Hi, I ran this example:

library(bcp)
##### univariate sequential data #####
# an easy problem with 2 true change points
set.seed(5)
x <- c(rnorm(50), rnorm(50, 5, 1), rnorm(50))
bcp.1a <- bcp(x)
plot(bcp.1a, main="Univariate Change Point Example")
legacyplot(bcp.1a)

From here: bcp: Performs a Bayesian analysis of change point problems in bcp: Bayesian Analysis of Change Point Problems and it was fine for me.

Perhaps restart RStudio and try again?

Hey there,

Thanks for your kind reply.
First, when you ran it, did you get the following error:

Error in rcpp_bcpM(as.matrix(y), as.integer(id), as.integer(return.mcmc),  : 
  function 'Rcpp_precious_remove' not provided by package 'Rcpp'

What I tried to do to overcome this issue is opening 'Rcpp'

So it looks like:

> library(bcp)
Loading required package: grid
Warning message:
package ‘bcp’ was built under R version 4.0.5 
> ##### univariate sequential data #####
> # an easy problem with 2 true change points
> set.seed(5)
> x <- c(rnorm(50), rnorm(50, 5, 1), rnorm(50))
> bcp.1a <- bcp(x)
Error in rcpp_bcpM(as.matrix(y), as.integer(id), as.integer(return.mcmc),  : 
  function 'Rcpp_precious_remove' not provided by package 'Rcpp'
> plot(bcp.1a, main="Univariate Change Point Example")
Error in plot(bcp.1a, main = "Univariate Change Point Example") : 
  object 'bcp.1a' not found
> legacyplot(bcp.1a)
Error in legacyplot(bcp.1a) : object 'bcp.1a' not found


#HERE I AM IMPORTING 'Rccp'


> library(Rcpp)
Warning message:
package ‘Rcpp’ was built under R version 4.0.3 
>

then i run this bit of code again:

set.seed(5)
x <- c(rnorm(50), rnorm(50, 5, 1), rnorm(50))
bcp.1a <- bcp(x)
plot(bcp.1a, main="Univariate Change Point Example")
legacyplot(bcp.1a)

and it freezes completely, I have to close it from the task manager as R doesn't respond:

Any ideas why that may be?

No errors for me. I am running this from RStudio rather than R Commander.

I also found this regarding the error, perhaps updating the Rcpp package?

Tried already, but didn't work! Thanks for your help tho!

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.