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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: ctqr
> ### Title: Censored and Truncated Quantile Regression
> ### Aliases: ctqr
> ### Keywords: survival models regression
> 
> ### ** Examples
> 
> # Using simulated data
> 
> n <- 1000
> x1 <- runif(n)
> x2 <- runif(n)
> 
> # Example 1 - censored data ######################################
> 
> t <- runif(n, 0, 1 + x1 + x2) # time variable (e.g., time to death)
> c <- runif(n,0,5)             # censoring variable (e.g., end of follow-up)
> y <- pmin(t,c) # observed variable = min(t,c)
> d <- (t <= c)  # 1 = event (e.g., death), 0 = censored
> 
> CDF1 <- pchreg(Surv(y,d) ~ x1 + x2, splinex = splinex())
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in while (class(v) == "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in while (class(v) == "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in while (class(v) == "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in while (class(v) == "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in while (class(v) == "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in while (class(v) == "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in while (class(v) == "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in while (class(v) == "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in while (class(v) == "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in while (class(v) == "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in while (class(v) == "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in while (class(v) == "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in while (class(v) == "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in while (class(v) == "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in while (class(v) == "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in while (class(v) == "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in while (class(v) == "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in while (class(v) == "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in while (class(v) == "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in while (class(v) == "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in while (class(v) == "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in while (class(v) == "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in while (class(v) == "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in while (class(v) == "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in while (class(v) == "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in while (class(v) == "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in while (class(v) == "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in while (class(v) == "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in while (class(v) == "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in while (class(v) == "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in while (class(v) == "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in if (class(H1) != "try-error") { :
  the condition has length > 1 and only the first element will be used
Warning in while (class(v) == "try-error") { :
  the condition has length > 1 and only the first element will be used
> model1 <- ctqr(Surv(y,d) ~ x1 + x2, p = 0.5, CDF = CDF1)
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
ctqr
 --- call from context --- 
asy(z, y, d, xfullrank, weights, p, CDF, fit, fit.ok = which(fit.ok))
 --- call from argument --- 
if (class(try.V2) != "try-error") {
    V2[[j]] <- try.V2
    V2.ok <- TRUE
} else {
    a <- a + 0.01
}
 --- R stacktrace ---
where 1: asy(z, y, d, xfullrank, weights, p, CDF, fit, fit.ok = which(fit.ok))
where 2: ctqr(Surv(y, d) ~ x1 + x2, p = 0.5, CDF = CDF1)

 --- value of length: 2 type: logical ---
[1] TRUE TRUE
 --- function from context --- 
function (z, y, d, x, weights, p, CDF, fit, fit.ok) 
{
    est.H2 <- function(fitted, y, d, x, weights, a) {
        eps <- 1e-07
        ok <- FALSE
        while (!ok) {
            eps <- eps * 2
            fitted.l <- fitted - eps
            fitted.r <- fitted + eps
            oy.l <- (y <= fitted.l)
            oy.r <- (y <= fitted.r)
            check <- mean(oy.l != oy.r)
            ok <- (check > a)
        }
        u.l <- d * (1 - pnorm(y - fitted.l, 0, eps))
        u.r <- d * (1 - pnorm(y - fitted.r, 0, eps))
        u <- (u.r - u.l)/(2 * eps)
        -t(x) %*% (x * c(weights * u))
    }
    n <- length(y)
    eta <- fit$fitted
    oy <- fit$omega.y
    oz <- fit$omega.z
    Sy <- pmax(fit$CDF$Sy, 1e-10)
    Sz <- pmax(fit$CDF$Sz, 1e-10)
    if (is.null(w1 <- model.weights(CDF$mf))) {
        w1 <- 1
    }
    w2 <- (if (!is.null(weights)) 
        weights
    else 1)
    si <- fit$si
    si[is.na(si)] <- 0
    A <- firstep(CDF, z, y, d, w1)
    V1 <- A$V
    S1 <- A$Si
    S2 <- V2 <- H12 <- list()
    for (j in fit.ok) {
        tau <- p[j]
        S2[[j]] <- x * si[, j]
        H12[[j]] <- t(x * w2) %*% ((1 - d) * oy[, j] * (1 - tau) * 
            A$dHy/Sy - oz[, j] * (1 - tau) * A$dHz/Sz)
        V2.ok <- FALSE
        a <- 0.05
        while (!V2.ok) {
            H2 <- est.H2(eta[, j], y, d, x, w2, a = a)
            try.V2 <- try(chol2inv(chol(-H2)), silent = TRUE)
            if (class(try.V2) != "try-error") {
                V2[[j]] <- try.V2
                V2.ok <- TRUE
            }
            else {
                a <- a + 0.01
            }
        }
    }
    COV <- list()
    for (j in fit.ok) {
        S <- cbind(S2[[j]], S1)
        Sw <- cbind(S2[[j]] * w2, S1 * w1)
        Omega <- rbind(cbind(V2[[j]], V2[[j]] %*% H12[[j]] %*% 
            V1), cbind(t(H12[[j]]) * 0, V1))
        Omega <- Omega %*% (t(S) %*% Sw) %*% t(Omega)
        COV[[length(COV) + 1]] <- Omega[1:ncol(x), 1:ncol(x), 
            drop = FALSE]
    }
    names(COV) <- p[fit.ok]
    COV
}
<bytecode: 0x55f733e23370>
<environment: namespace:ctqr>
 --- function search by body ---
Function asy.qr in namespace ctqr has this body.
 ----------- END OF FAILURE REPORT -------------- 
Fatal error: the condition has length > 1