Running examples in ‘offlineChange-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: ChangePointsPlot
> ### Title: Plot Peak Ranges of Change Points
> ### Aliases: ChangePointsPlot
> 
> ### ** Examples
> 
> N <- 1000
> N1 <- floor(0.1*N)
> N2 <- floor(0.3*N)
> a1 <- c(0.8, -0.3); c1 <- 0
> a2 <- c(-0.5, 0.1); c2 <- 0
> a3 <- c(0.5, -0.5); c3 <- 0
> y <- rep(0,N)
> L<-2
> y[1:L] <- rnorm(L)
> for (n in (L+1):N){
+   if (n <= N1) {
+     y[n] <- y[(n-1):(n-L)] %*% a1 + c1 + rnorm(1)
+   } else if (n <= (N1+N2)) {
+     y[n] <- y[(n-1):(n-L)] %*% a2 + c2 + rnorm(1)
+   }
+   else {
+     y[n] <- y[(n-1):(n-L)] %*% a3 + c3 + rnorm(1)
+   }
+ }
> result <- MultiWindow(y,window_list=c(100,50,20,10,5),point_max=5)
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
offlineChange
 --- call from context --- 
MultiWindow(y, window_list = c(100, 50, 20, 10, 5), point_max = 5)
 --- call from argument --- 
if (class(x) != "matrix") {
    x <- as.matrix(x)
}
 --- R stacktrace ---
where 1: MultiWindow(y, window_list = c(100, 50, 20, 10, 5), point_max = 5)

 --- value of length: 2 type: logical ---
[1] FALSE  TRUE
 --- function from context --- 
function (y, window_list = c(100, 50, 20, 10, 5), point_max = 5, 
    prior_range = NULL, get_mle = GetMle, penalty = "bic", seg_min = 1, 
    num_init = NULL, tolerance = 1, cpp = TRUE, ret_score = FALSE) 
{
    len <- length(y)
    n_window_type <- length(window_list)
    score <- matrix(0, nrow = len, ncol = n_window_type)
    for (r in 1:n_window_type) {
        window_size <- window_list[r]
        n_window <- ceiling(len/window_size)
        x <- get_mle(y, window_size = window_size)
        if (class(x) != "matrix") {
            x <- as.matrix(x)
        }
        if (is.null(prior_range)) {
            change_point <- ChangePoints(x, point_max = point_max, 
                penalty = penalty, seg_min = 1, num_init = num_init, 
                cpp = cpp)$change_point
        }
        else {
            trans_prior_range <- list()
            for (i in 1:length(prior_range)) {
                transformed_range = numeric(2)
                transformed_range[1] <- ceiling(prior_range[[i]][1]/window_size)
                transformed_range[2] <- ceiling(prior_range[[i]][2]/window_size)
                trans_prior_range[[i]] <- transformed_range
            }
            change_point <- PriorRangeOrderKmeans(x, prior_range_x = trans_prior_range, 
                num_init = num_init)$change_point
        }
        if (r == 1) {
            for (k in 1:(length(change_point))) {
                score[(1 + (change_point[k] - 1) * window_size):min((change_point[k] + 
                  1) * window_size, len), r] <- score[(1 + (change_point[k] - 
                  1) * window_size):min((change_point[k] + 1) * 
                  window_size, len), r] + 1
            }
        }
        else {
            score[1:len, r] <- score[1:len, r - 1]
            for (k in 1:(length(change_point))) {
                score[(1 + (change_point[k] - 1) * window_size):min((change_point[k] + 
                  1) * window_size, len), r] <- score[(1 + (change_point[k] - 
                  1) * window_size):min((change_point[k] + 1) * 
                  window_size, len), (r - 1)] + 1
            }
        }
    }
    if (!is.null(prior_range)) {
        point_max <- length(prior_range)
    }
    peakranges <- PeakRange(score = score, tolerance = tolerance, 
        point_max = point_max)
    result <- list(n_peak_range = peakranges$n_peak_range, peak_range = peakranges$peak_range)
    if (ret_score) {
        result$score <- score
    }
    return(result)
}
<bytecode: 0x5591b2516a28>
<environment: namespace:offlineChange>
 --- function search by body ---
Function MultiWindow in namespace offlineChange has this body.
 ----------- END OF FAILURE REPORT -------------- 
Error in if (class(x) != "matrix") { : the condition has length > 1
Calls: MultiWindow
Execution halted