Running examples in 'SiZer-Ex.R' failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: SiZer
> ### Title: Calculate SiZer Map
> ### Aliases: SiZer
> 
> ### ** Examples
> 
> data('Arkansas')
> x <- Arkansas$year
> y <- Arkansas$sqrt.mayflies
> 
> plot(x,y)
> 
> # Calculate the SiZer map for the first derivative
> SiZer.1 <- SiZer(x, y, h=c(.5,10), degree=1, derv=1, grid.length=21)
[1] 0.5
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
SiZer
 --- call from context --- 
locally.weighted.polynomial(x, y, h = h, x.grid = x.grid, degree = degree)
 --- call from argument --- 
if (class(XtWXinv) == "try-error") {
    out$Beta[, count] <- rep(NA, degree + 1)
    unscaled.var[, count] <- rep(NA, degree + 1)
} else {
    beta <- XtWXinv %*% XtW %*% y
    out$Beta[, count] <- beta
    unscaled.var[, count] <- diag(XtWXinv %*% XtW2 %*% X %*% 
        t(XtWXinv))
}
 --- R stacktrace ---
where 1: locally.weighted.polynomial(x, y, h = h, x.grid = x.grid, degree = degree)
where 2: SiZer(x, y, h = c(0.5, 10), degree = 1, derv = 1, grid.length = 21)

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (x, y, h = NA, x.grid = NA, degree = 1, kernel.type = "Normal") 
{
    x.grid <- x.grid.create(x.grid, x, y)
    if (is.na(h)) {
        h <- stats::bw.SJ(x)
    }
    out <- NULL
    out$data <- NULL
    out$data$x <- x
    out$data$y <- y
    out$data$n <- length(x)
    out$h <- h
    out$x.grid <- x.grid
    out$effective.sample.sizes <- rep(NA, length(x.grid))
    out$Beta <- matrix(nrow = degree + 1, ncol = length(x.grid))
    unscaled.var <- out$Beta
    out$Beta.var <- out$Beta
    var.y.given.x <- rep(0, length(x.grid))
    count <- 1
    for (x.star in x.grid) {
        X <- NULL
        for (i in 0:degree) {
            X <- cbind(X, (x - x.star)^i)
        }
        w <- kernel.h(x - x.star, h, type = kernel.type)
        w2 <- w^2
        XtW <- t(apply(X, 2, function(x) {
            x * w
        }))
        XtW2 <- t(apply(X, 2, function(x) {
            x * w2
        }))
        XtWXinv <- try(solve(XtW %*% X), silent = TRUE)
        if (class(XtWXinv) == "try-error") {
            out$Beta[, count] <- rep(NA, degree + 1)
            unscaled.var[, count] <- rep(NA, degree + 1)
        }
        else {
            beta <- XtWXinv %*% XtW %*% y
            out$Beta[, count] <- beta
            unscaled.var[, count] <- diag(XtWXinv %*% XtW2 %*% 
                X %*% t(XtWXinv))
        }
        count <- count + 1
    }
    index <- which(!is.na(out$Beta[1, ]))
    if (length(index) > 2) {
        x.grid.small <- x.grid[index]
        interp <- splines::interpSpline(x.grid.small, out$Beta[1, 
            index])
        out$residuals <- y - stats::predict(interp, x)$y
        for (i in 1:length(x.grid.small)) {
            divisor <- 0
            for (j in 1:length(x)) {
                kernel <- kernel.h(x.grid.small[i] - x[j], h, 
                  type = kernel.type)
                var.y.given.x[i] <- var.y.given.x[i] + (out$residuals[j])^2 * 
                  kernel
                divisor <- divisor + kernel
            }
            var.y.given.x[i] <- var.y.given.x[i]/divisor
        }
    }
    index <- which(var.y.given.x == 0)
    var.y.given.x[index] <- NA
    for (i in 1:length(x.grid)) {
        sum <- 0
        for (j in 1:length(x)) {
            sum <- sum + kernel.h(x.grid[i] - x[j], h, type = kernel.type)
        }
        out$effective.sample.sizes[i] <- sum/kernel.h(0, h, type = kernel.type)
    }
    for (i in 1:length(x.grid)) {
        out$Beta.var[, i] <- unscaled.var[, i] * var.y.given.x[i]
    }
    class(out) <- "LocallyWeightedPolynomial"
    return(out)
}
<bytecode: 0x45335b0>
<environment: namespace:SiZer>
 --- function search by body ---
Function locally.weighted.polynomial in namespace SiZer has this body.
 ----------- END OF FAILURE REPORT -------------- 
Error in if (class(XtWXinv) == "try-error") { : 
  the condition has length > 1
Calls: SiZer -> locally.weighted.polynomial
Execution halted