Running 'panel.R' [3s/3s]
  Running 'rq.R' [3s/3s]
  Running 'rq.fit.panel.R' [0s/1s]
  Running 'run-demos.R' [27s/30s]
Running the tests in 'tests/run-demos.R' failed.
Complete output:
  > library(quantreg)
  Loading required package: SparseM
  
  Attaching package: 'SparseM'
  
  The following object is masked from 'package:base':
  
      backsolve
  
  > 
  > (dDIR <- system.file("demo", package = "quantreg"))
  [1] "/home/hornik/tmp/R.check/r-devel-clang/Work/build/Packages/quantreg/demo"
  > set.seed(1) # since some demos randomly generate
  > 
  > cat("Running demos from package 'quantreg' : \n\n")
  Running demos from package 'quantreg' : 
  
  > for(ff in list.files(dDIR, pattern="\\.R$", full.names = TRUE)) {
  +    f <- basename(ff)
  +    cat("\n", f," :\n", paste(rep.int("-", nchar(f)), collapse=''),
  +        "\n", sep='')
  + 
  +    source(ff, echo = TRUE)
  + }
  
  Frank.R :
  -------
  
  > vFrank <- function(x, df, delta, u) -log(1 - (1 - 
  +     exp(-delta))/(1 + exp(-delta * pt(x, df)) * ((1/u) - 1)))/delta
  
  > FrankModel <- function(x, delta, mu, sigma, df, tau) {
  +     z <- qt(vFrank(x, df, delta, u = tau), df)
  +     mu + sigma * z
  + }
  
  > n <- 200
  
  > df <- 8
  
  > delta <- 8
  
  > set.seed(1989)
  
  > x <- sort(rt(n, df))
  
  > v <- vFrank(x, df, delta, u = runif(n))
  
  > y <- qt(v, df)
  
  > plot(x, y, pch = "o", col = "blue", cex = 0.25)
  
  > Dat <- data.frame(x = x, y = y)
  
  > us <- c(0.25, 0.5, 0.75)
  
  > for (i in 1:length(us)) {
  +     v <- vFrank(x, df, delta, u = us[i])
  +     lines(x, qt(v, df))
  + }
  
  > cfMat <- matrix(0, 3, length(us))
  
  > trace <- TRUE
  
  > trace <- FALSE
  
  > for (i in 1:length(us)) {
  +     tau <- us[i]
  +     cat("tau = ", format(tau), ".. ")
  +     fit <- nlrq(y ~ FrankModel(x, delta, mu, sigma, df = 8, t .... [TRUNCATED] 
  tau =  0.25 .. 
  tau =  0.5 .. 
  tau =  0.75 .. 
  
  > colnames(cfMat) <- names(coef(fit))
  
  > cfMat
          delta          mu     sigma
  [1,] 14.87905 -0.20543639 0.9133560
  [2,] 16.02873  0.03036451 0.9665537
  [3,] 12.04705  0.11612377 0.9460523
  
  KMvCRQ.R :
  --------
  
  > if (requireNamespace("survival", quietly = TRUE)) {
  +     n <- 100
  +     y <- rchisq(n, 3)
  +     c <- rchisq(n, 5)
  +     Y <- pmin(y, c)
  +     d <-  .... [TRUNCATED] 
  
  Mammals.R :
  ---------
  
  > require(quantreg)
  
  > data(Mammals)
  
  > attach(Mammals)
  
  > x <- log(weight)
  
  > xx <- unique(x[order(x)])
  
  > y <- log(speed)
  
  > plot(x, y, xlab = "Weight in log(Kg)", ylab = "Speed in log(Km/hour)", 
  +     type = "n")
  
  > points(x[hoppers], y[hoppers], pch = "h", col = "red")
  
  > points(x[specials], y[specials], pch = "s", col = "blue")
  
  > others <- (!hoppers & !specials)
  
  > points(x[others], y[others], col = "black", cex = 0.75)
  
  > taus <- c(0.5, 0.9)
  
  > for (i in 1:length(taus)) {
  +     fit <- rqss(y ~ qss(x, lambda = 1, constraint = "C"), tau = taus[i])
  +     plot(fit, title = "Running Speed of Mam ..." ... [TRUNCATED] 
  
  > legend(4, 2, c("Median", "0.9 Quantile"), lty = 1, 
  +     col = 1:2, lwd = 1.5)
  
  > plot(fit, title = "Running Speed of Mammals", band = "both", 
  +     col = i, lwd = 1.5)
  
  > xy <- fit$qss[[1]]$xyz
  
  > xx <- xy[, 1]
  
  > yhat <- fit$coef[1] + xy[, 2]
  
  > g <- diff(yhat)/diff(xx)
  
  > plot(xx[-1], g, main = "Fitted Slopes of Running Speed", 
  +     xlab = "Weight in log(Kg)", ylab = "dlog(Speed) /dlog(Weight)")
  
  Mel.R :
  -----
  
  > require(splines)
  Loading required package: splines
  
  > if (require(hdrcde)) {
  +     if (interactive()) {
  +         oldpar <- par(ask = TRUE)
  +         x <- maxtemp[-3650]
  +         y <- maxtemp[-1]
  +     .... [TRUNCATED] 
  Loading required package: hdrcde
  This is hdrcde 3.3
  
  Mel2.R :
  ------
  
  > require(splines)
  
  > if (require(hdrcde)) {
  +     if (interactive()) {
  +         oldpar <- par(ask = TRUE)
  +         x <- maxtemp[-3650]
  +         y <- maxtemp[-1]
  +     .... [TRUNCATED] 
  
  Panel.R :
  -------
  
  > library(quantreg)
  
  > rq.fit.panel <- function(X, y, s, w = c(1/3, 1/3, 
  +     1/3), taus = c(0.25, 0.5, 0.75), lambda = 0) {
  +     require(SparseM)
  +     require(quantre .... [TRUNCATED] 
  
  > n <- 3
  
  > T <- 50
  
  > nT <- n * T
  
  > u1 <- rnorm(T)
  
  > u2 <- rnorm(T)
  
  > u3 <- rnorm(T)
  
  > x1 <- rnorm(T, 1, 0.85)
  
  > x2 <- rnorm(T, 4, 1)
  
  > x3 <- rnorm(T, 7, 1)
  
  > beta1 <- 1
  
  > beta2 <- 0.5
  
  > y1 <- 0 + beta1 * x1 + (beta2 * x1) * u1
  
  > y2 <- 4 + beta1 * x2 + (beta2 * x2) * u2
  
  > y3 <- 8 + beta1 * x3 + (beta2 * x3) * u3
  
  > plot(c(0, 9), c(0, 25), type = "n", xlab = expression(x[it]), 
  +     ylab = expression(y[it]))
  
  > points(x1, y1, pch = 15)
  
  > points(x2, y2, pch = 15, col = "blue")
  
  > points(x3, y3, pch = 15, col = "red")
  
  > legend(1, 17, paste("i = ", 1:3, sep = ""), pch = 15, 
  +     col = c("black", "blue", "red"))
  
  > ya <- c(y1, y2, y3)
  
  > xa <- c(x1, x2, x3)
  
  > taus <- c(0.25, 0.5, 0.75)
  
  > xx <- seq(min(xa), max(xa), 0.25)
  
  > f <- coef(rq(ya ~ xa, tau = taus))
  
  > yy <- cbind(1, xx) %*% f
  
  > for (i in 1:3) lines(xx, yy[, i], col = "grey")
  
  > s <- rep(1:n, rep(T, n))
  
  > fp <- rq.fit.panel(xa, ya, s)$coef
  
  > bhat <- fp[1:3]
  
  > fehat <- fp[4:6]
  
  > xx1 <- seq(min(x1), max(x1), 0.25)
  
  > for (i in 1:3) {
  +     yy1 <- fehat[1] + bhat[i] * xx1
  +     lines(xx1, yy1, col = "black")
  + }
  
  > xx2 <- seq(min(x2), max(x2), 0.25)
  
  > for (i in 1:3) {
  +     yy2 <- fehat[2] + bhat[i] * xx2
  +     lines(xx2, yy2, col = "blue")
  + }
  
  > xx3 <- seq(min(x3), max(x3), 0.25)
  
  > for (i in 1:3) {
  +     yy3 <- fehat[3] + bhat[i] * xx3
  +     lines(xx3, yy3, col = "red")
  + }
  
  Polson.R :
  --------
  
  > dgp <- function(n) {
  +     x <- 0:n/n
  +     y <- rnorm(n + 1, 5 * sin(2 * pi * x), 0.5 + exp(1.5 * sin(4 * 
  +         pi * x)))
  +     data.frame(x = .... [TRUNCATED] 
  
  > D <- dgp(1000)
  
  > plot(D$x, D$y, cex = 0.5)
  
  > taus <- 1:9/10
  
  > for (i in 1:length(taus)) plot(rqss(y ~ qss(x, lambda = 1/10), 
  +     tau = taus[i], data = D), rug = FALSE, add = TRUE)
  
  RB-r.R :
  ------
  
  > require(MASS)
  Loading required package: MASS
  
  > require(quantreg)
  
  > X <- cbind(1, matrix(rnorm(500), 100, 5))
  
  > y <- rnorm(100)
  
  > R <- matrix(rnorm(18), 3, 6)
  
  > r <- rep(1, 3)
  
  > R <- t(R)
  
  > P <- Null(R)
  
  > Xt <- t(lsfit(P, t(X), intercept = FALSE)$coef)
  
  > Zt <- t(lsfit(R, t(X), intercept = FALSE)$coef)
  
  > yt <- y - Zt %*% r
  
  > f0 <- rq(yt ~ Xt - 1)
  
  > f1 <- rq(yt ~ Xt + Zt - 1)
  
  > T <- anova(f0, f1)
  
  arqss.R :
  -------
  
  > n <- 2000
  
  > x <- 1:n/n
  
  > noise <- rgamma(n, 3, 1)
  
  > g0 <- function(x) sin(10 * x)
  
  > y <- g0(x) + noise
  
  > arqss <- function(x, y, tau, g0 = NULL) {
  +     g <- function(lam, y, x, tau) AIC(rqss(y ~ qss(x, lambda = lam), 
  +         tau = tau), k = -1)
  +    .... [TRUNCATED] 
  
  > arqss(x, y, 0.5, g0)
  
  cobar.R :
  -------
  
  > require(quantreg)
  
  > do.rgl <- interactive() && require(rgl)
  
  > data(CobarOre)
  
  > fit <- rqss(z ~ qss(cbind(x, y), lambda = 0.01, ndum = 100), 
  +     data = CobarOre)
  Loading required namespace: tripack
  
  > dummies <- fit$qss[[1]]$dummies
  
  > zcol <- CobarOre$z
  
  > if (do.rgl) {
  +     plot(fit, render = "rgl")
  +     cat("Now orient the plot as needed:", "Resize window,", "mouse button 1 to change viewpoint,", 
   .... [TRUNCATED] 
  Loading required namespace: akima
  
  > for (i in 1:20) {
  +     fname <- paste("cobar", i, ".png", sep = "")
  +     lam <- 2 * i/100
  +     fit <- rqss(z ~ qss(cbind(x, y), lambda = lam, dum .... [TRUNCATED] 
  
  combos.R :
  --------
  
  > H <- combos(20, 3)
  
  > if (!require("rgl", quietly = TRUE)) {
  +     warning("The package rgl is needed for plotting")
  + } else {
  +     if (interactive()) {
  +         plot3 .... [TRUNCATED] 
  
  cpoint.R :
  --------
  
  > x <- runif(200, 0, 10)
  
  > u <- rnorm(200)/5
  
  > y <- 1 + x - 0.5 * (x - 3) * (x > 3) + u
  
  > plot(y ~ x, cex = 0.5, col = "grey")
  
  > z <- rqss(y ~ qss(x, lambda = 10), tau = 0.5)
  
  > plot(z, col = "dark blue")
  
  > eps <- 1e-05
  
  > Nz <- abs(z$resid[1:200]) < eps
  
  > Nj <- abs(z$resid[201:398]) > eps
  
  > xx <- z$qss[[1]]$xyz[, 1]
  
  > yy <- z$coef[1] + z$qss[[1]]$xyz[, 2]
  
  > xj <- xx[3:200]
  
  > yj <- yy[3:200]
  
  > points(xx[Nz], yy[Nz], col = "green")
  
  > points(xj[Nj], yj[Nj], col = "red")
  
  > print(paste("Number of zero residuals:  ", sum(Nz)))
  [1] "Number of zero residuals:   3"
  
  > print(paste("Number of jumps in slope:  ", sum(Nj)))
  [1] "Number of jumps in slope:   45"
  
  > legend(6, 3, c("Derivative Jumps", "Zero residuals"), 
  +     pch = "o", col = c("red", "green"))
  
  crquis.R :
  --------
  
  > if (requireNamespace("survival", quietly = TRUE)) {
  +     data(uis)
  +     Surv <- survival::Surv
  +     fit <- crq(Surv(log(TIME), CENSOR) ~ ND1 + ND .... [TRUNCATED] 
  
  engel1.R :
  --------
  
  > data(engel)
  
  > plot(foodexp ~ income, data = engel, cex = 0.5, col = "blue", 
  +     xlab = "Household Income", ylab = "Food Expenditure")
  
  > z <- rq(foodexp ~ income, tau = 0.5, data = engel)
  
  > abline(z, col = "dark blue")
  
  > abline(lm(foodexp ~ income, data = engel), lty = 2, 
  +     col = "red")
  
  > taus <- c(0.05, 0.1, 0.25, 0.75, 0.9, 0.95)
  
  > nt <- length(taus)
  
  > for (i in 1:length(taus)) {
  +     abline(rq(foodexp ~ income, tau = taus[i], data = engel), 
  +         col = "gray")
  + }
  
  > legend("bottomright", c("L1 (tau = .50)", "OLS", paste("tau= ", 
  +     formatC(rev(taus)))), col = c("dark blue", "red", rep("gray", 
  +     nt)), lt .... [TRUNCATED] 
  
  engel2.R :
  --------
  
  > data(engel)
  
  > x.poor <- quantile(engel[, "income"], 0.1)
  
  > x.rich <- quantile(engel[, "income"], 0.9)
  
  > z <- rq(foodexp ~ income, tau = -1, data = engel)
  
  > ps <- z$sol["tau", ]
  
  > coefs <- z$sol[4:5, ]
  
  > qs.poor <- c(c(1, x.poor) %*% coefs)
  
  > qs.rich <- c(c(1, x.rich) %*% coefs)
  
  > par(mfrow = c(1, 2))
  
  > plot(c(ps, ps), c(qs.poor, qs.rich), type = "n", xlab = expression(tau), 
  +     ylab = "quantile")
  
  > plot(stepfun(ps, c(qs.poor[1], qs.poor)), do.points = FALSE, 
  +     add = TRUE)
  
  > plot(stepfun(ps, c(qs.poor[1], qs.rich)), do.points = FALSE, 
  +     add = TRUE, col.hor = "gray", col.vert = "gray")
  
  > ps.wts <- (c(0, diff(ps)) + c(diff(ps), 0))/2
  
  > ap <- akj(qs.poor, z = qs.poor, p = ps.wts)
  
  > ar <- akj(qs.rich, z = qs.rich, p = ps.wts)
  
  > plot(c(qs.poor, qs.rich), c(ap$dens, ar$dens), type = "n", 
  +     xlab = "Food Expenditure", ylab = "Density")
  
  > lines(qs.rich, ar$dens, col = "gray")
  
  > lines(qs.poor, ap$dens, col = "black")
  
  > legend("topright", c("poor", "rich"), lty = c(1, 1), 
  +     col = c("black", "gray"))
  
  hinged.R :
  --------
  
  > require(quantreg)
  
  > do.rgl <- interactive() && require(rgl)
  
  > n <- 1000
  
  > x <- runif(n)
  
  > y <- runif(n)
  
  > z <- -abs(x - y)
  
  > fit <- rqss(z ~ qss(cbind(x, y), lambda = 0.005))
  
  > print(summary(fit)$penalty)
  NULL
  
  > if (do.rgl) {
  +     plot(fit, render = "rgl")
  +     cat("Now orient the plot as desired:", "Resize window,", 
  +         "mouse button 1 to change vi ..." ... [TRUNCATED] 
  
  panelfig.R :
  ----------
  
  > library(quantreg)
  
  > rq.fit.panel <- function(X, y, s, w = c(1/3, 1/3, 
  +     1/3), taus = c(0.25, 0.5, 0.75), lambda = 0) {
  +     require(SparseM)
  +     require(quantre .... [TRUNCATED] 
  
  > n <- 3
  
  > T <- 50
  
  > nT <- n * T
  
  > u1 <- rnorm(T)
  
  > u2 <- rnorm(T)
  
  > u3 <- rnorm(T)
  
  > x1 <- rnorm(T, 1, 0.85)
  
  > x2 <- rnorm(T, 4, 1)
  
  > x3 <- rnorm(T, 7, 1)
  
  > beta1 <- 1
  
  > beta2 <- 0.5
  
  > y1 <- 0 + beta1 * x1 + (beta2 * x1) * u1
  
  > y2 <- 4 + beta1 * x2 + (beta2 * x2) * u2
  
  > y3 <- 8 + beta1 * x3 + (beta2 * x3) * u3
  
  > plot(c(0, 9), c(0, 25), type = "n", xlab = expression(x[it]), 
  +     ylab = expression(y[it]))
  
  > points(x1, y1, pch = 15)
  
  > points(x2, y2, pch = 15, col = "blue")
  
  > points(x3, y3, pch = 15, col = "red")
  
  > legend(1, 17, paste("i = ", 1:3, sep = ""), pch = 15, 
  +     col = c("black", "blue", "red"))
  
  > ya <- c(y1, y2, y3)
  
  > xa <- c(x1, x2, x3)
  
  > taus <- c(0.25, 0.5, 0.75)
  
  > xx <- seq(min(xa), max(xa), 0.25)
  
  > f <- coef(rq(ya ~ xa, tau = taus))
  
  > yy <- cbind(1, xx) %*% f
  
  > for (i in 1:3) lines(xx, yy[, i], col = "grey")
  
  > s <- rep(1:n, rep(T, n))
  
  > fp <- rq.fit.panel(xa, ya, s)$coef
  
  > bhat <- fp[1:3]
  
  > fehat <- fp[4:6]
  
  > xx1 <- seq(min(x1), max(x1), 0.25)
  
  > for (i in 1:3) {
  +     yy1 <- fehat[1] + bhat[i] * xx1
  +     lines(xx1, yy1, col = "black")
  + }
  
  > xx2 <- seq(min(x2), max(x2), 0.25)
  
  > for (i in 1:3) {
  +     yy2 <- fehat[2] + bhat[i] * xx2
  +     lines(xx2, yy2, col = "blue")
  + }
  
  > xx3 <- seq(min(x3), max(x3), 0.25)
  
  > for (i in 1:3) {
  +     yy3 <- fehat[3] + bhat[i] * xx3
  +     lines(xx3, yy3, col = "red")
  + }
  
  predemo.R :
  ---------
  
  > par(ask = TRUE)
  
  > sub <- "Classical Gaussian Version"
  
  > plot(cars$speed, cars$dist, xlim = c(0, 27), ylim = c(-10, 
  +     130), main = "Ezekiel Data", sub = sub, xlab = "speed (mph)", 
  +     ylab = "stopp ..." ... [TRUNCATED] 
  
  > ss = seq(0, 27, len = 100)
  
  > flm <- lm(dist ~ speed + I(speed^2), data = cars)
  
  > cflm <- predict(flm, list(speed = ss), data = cars, 
  +     interval = "confidence")
  
  > pflm <- predict(flm, list(speed = ss), data = cars, 
  +     interval = "prediction")
  
  > matlines(ss, pflm, lty = c(1, 2, 2), col = c("black", 
  +     "red", "red"))
  
  > matlines(ss, cflm, lty = c(1, 2, 2), col = c("black", 
  +     "blue", "blue"))
  
  > fl = rq(dist ~ speed + I(speed^2), data = cars, tau = 0.25)
  
  > fu = rq(dist ~ speed + I(speed^2), data = cars, tau = 0.75)
  
  > sub <- "Covariance matrix estimation using nid"
  
  > plot(cars$speed, cars$dist, xlim = c(0, 27), ylim = c(-10, 
  +     130), main = "Ezekiel Data", sub = sub, xlab = "speed (mph)", 
  +     ylab = "stopp ..." ... [TRUNCATED] 
  
  > pl <- predict(fl, list(speed = ss), interval = "confidence", 
  +     se = "nid")
  
  > pu <- predict(fu, list(speed = ss), interval = "confidence", 
  +     se = "nid")
  
  > matlines(ss, pl, lty = c(1, 2, 0), col = c("black", 
  +     "red", "red"))
  
  > matlines(ss, pu, lty = c(1, 0, 2), col = c("black", 
  +     "red", "red"))
  
  > sub <- "Covariance matrix estimation using xy-bootstrap"
  
  > plot(cars$speed, cars$dist, xlim = c(0, 27), ylim = c(-10, 
  +     130), main = "Ezekiel Data", sub = sub, xlab = "speed (mph)", 
  +     ylab = "stopp ..." ... [TRUNCATED] 
  
  > pl <- predict(fl, list(speed = ss), interval = "confidence", 
  +     se = "boot", bsmethod = "xy")
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  quantreg
   --- call from context --- 
  boot.rq(x, y, tau, ...)
   --- call from argument --- 
  if (class(x) != "matrix.csr") x <- as.matrix(x)
   --- R stacktrace ---
  where 1: boot.rq(x, y, tau, ...)
  where 2: summary.rq(object, cov = TRUE, ...)
  where 3: summary(object, cov = TRUE, ...)
  where 4: summary(object, cov = TRUE, ...)
  where 5: predict.rq(fl, list(speed = ss), interval = "confidence", se = "boot", 
      bsmethod = "xy")
  where 6: predict(fl, list(speed = ss), interval = "confidence", se = "boot", 
      bsmethod = "xy")
  where 7: eval(ei, envir)
  where 8: eval(ei, envir)
  where 9: withVisible(eval(ei, envir))
  where 10: source(ff, echo = TRUE)
  
   --- value of length: 2 type: logical ---
  [1] TRUE TRUE
   --- function from context --- 
  function (x, y, tau = 0.5, R = 200, bsmethod = "xy", mofn = length(y), 
      blbn = NULL, cluster = NULL, U = NULL, ...) 
  {
      n <- length(y)
      if (class(x) != "matrix.csr") 
          x <- as.matrix(x)
      p <- ncol(x)
      B <- matrix(0, R, p)
      if (tau <= 0 || tau >= 1) 
          stop("tau outside (0,1) not allowed")
      if (length(cluster)) 
          bsmethod <- "cluster"
      if (bsmethod == "xy") {
          if (!length(U)) {
              if (mofn < p || mofn > n) 
                  stop("mofn is out of range")
              U <- matrix(sample(n, mofn * R, replace = TRUE), 
                  mofn, R)
          }
          B <- sqrt(mofn/n) * boot.rq.xy(x, y, U, tau)
      }
      else if (bsmethod == "wxy") {
          if (!length(U)) 
              U <- matrix(rexp(n * R, 1), n, R)
          B <- boot.rq.wxy(x, y, U, tau)
      }
      else if (bsmethod == "BLB") {
          b <- length(y)
          if (!length(U)) 
              U <- rmultinom(R, blbn, rep(1/b, b))
          B <- boot.rq.wxy(x, y, U, tau)
      }
      else if (bsmethod == "cluster") {
          if (!length(U)) {
              if (length(cluster) != n) 
                  stop("cluster is wrong length")
              u <- unique(cluster)
              m <- length(u)
              h <- c(-(sqrt(5) - 1)/2, (sqrt(5) + 1)/2)
              hp <- c((sqrt(5) + 1)/sqrt(20), (sqrt(5) - 1)/sqrt(20))
              U <- matrix(sample(h, R * m, prob = hp, replace = TRUE), 
                  m, R)
              U <- apply(U, 2, function(v) v[match(cluster, u)])
          }
          r <- c(rq.fit(x, y, tau)$resid)
          psi <- (r < 0) - tau
          W <- as.matrix(t(x) %*% (U * psi))
          if (class(x) == "matrix.csr") 
              B <- boot.rq.spwy(W, x, y, tau)
          else B <- boot.rq.pwy(W, x, y, tau)
      }
      else if (bsmethod == "jack") {
          if (!length(U)) {
              if (missing(mofn)) 
                  mofn <- n - ceiling(2 * sqrt(n))
              if (mofn < p || mofn > n) 
                  stop("mofn is out of range")
              U <- matrix(0, mofn, R)
              U <- apply(U, 2, function(x) sample(n, mofn))
          }
          B <- (mofn - p + 1)/sqrt(n * (n - mofn)) * boot.rq.xy(x, 
              y, U, tau)
      }
      else if (bsmethod == "pwy") {
          if (!length(U)) {
              U <- matrix(runif(n * R), n, R)
          }
          W <- t(x) %*% ((U < tau) - tau)
          B <- boot.rq.pwy(W, x, y, tau)
      }
      else if (bsmethod == "mcmb") {
          B <- boot.rq.mcmb(x, y, tau = tau, R = R)
      }
      else if (bsmethod == "wild") {
          n <- length(y)
          fit <- rq.fit(x, y, tau = tau)
          S <- sample(c(-2 * tau, 2 * (1 - tau)), prob = c(tau, 
              1 - tau), size = n * R, replace = TRUE)
          W <- matrix(S, n, R)
          r <- c(fit$resid)
          f0 <- akj(r, z = 0)$dens
          r <- r + hat(x) * (tau - I(r < 0))/f0
          Y <- c(fitted(fit)) + W * abs(r)
          B <- rqs.fit(x, Y, tau = tau)
      }
      else stop("your chosen bootstrap method is not allowed")
      list(B = B, U = U)
  }
  <bytecode: 0xbf0e940>
  <environment: namespace:quantreg>
   --- function search by body ---
  Function boot.rq in namespace quantreg has this body.
   ----------- END OF FAILURE REPORT -------------- 
  Fatal error: the condition has length > 1