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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: edr
> ### Title: Estimation of the effective dimension reduction (EDR) space:
> ###   Structure adaptive approach for dimension reduction
> ### Aliases: edr
> ### Keywords: smooth regression
> 
> ### ** Examples
> 
> require(EDR)
> demo(edr_ex1)


	demo(edr_ex1)
	---- ~~~~~~~

> require(EDR)

> example1<-function(d,n,sigma){
+ f1 <- function(x) x*sin(sqrt(5)*x)
+ x <- matrix(2*rbeta(n*d,1,1)-1,n,d)
+ R1 <- matrix(0,d,d)
+ R1[1,] <- c(1,2,rep(0,d-2))/sqrt(5)
+ fx <- f1(x%*%t(R1)[,1])
+ y <- rnorm(n,fx,sigma)
+ list(y=y,x=x,fx=fx,R1=R1)
+ }

> #
> #  Estimate the effective dimension reduction space
> #
> d <- readline("Press 'Enter' for 10-dimensional example, otherwise provide the dimension:")
Press 'Enter' for 10-dimensional example, otherwise provide the dimension:

> if(is.na(as.integer(d))) d <- 10 else d <- as.integer(d)

> if(d<3) {
+ print("d should be larger than 2, d=10 is used \n")
+ d <- 10
+ }

> if(d>50) { 
+ print("d  larger than 50 takes to much time for a demo, d=50 is used \n")
+ d <- 50
+ }

> n <- 10*d

> sigma <- 0.25

> set.seed(1)

> z<-example1(d,n,sigma)

> zg<-list(x=z$x,y=z$y,fhat=z$fx,bhat=t(z$R1))

> cat("Show projection into the effective dimension reduction space (EDR)\n")
Show projection into the effective dimension reduction space (EDR)

> plot.edr(zg,title="Projection into the true EDR",sm=FALSE)
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
EDR
 --- call from context --- 
edr.R(bhat, 1)
 --- call from argument --- 
if (class(B) == "edr") B <- B$bhat
 --- R stacktrace ---
where 1: edr.R(bhat, 1)
where 2: t(edr.R(bhat, 1))
where 3: plot(xx %*% t(edr.R(bhat, 1)), yy, xlab = "R_m%*%x", ylab = ylab, 
    ...)
where 4 at /home/hornik/tmp/R.check/r-devel-clang/Work/build/Packages/EDR/demo/edr_ex1.r#31: plot.edr(zg, title = "Projection into the true EDR", sm = FALSE)
where 5: eval(ei, envir)
where 6: eval(ei, envir)
where 7: withVisible(eval(ei, envir))
where 8: source(available, echo = echo, max.deparse.length = Inf, keep.source = TRUE, 
    encoding = encoding)
where 9: demo(edr_ex1)

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (B, m) 
{
    if (class(B) == "edr") 
        B <- B$bhat
    dimbhat <- dim(B)
    if (is.null(dimbhat) || length(dimbhat) != 2) 
        return(warning("Argument B should be of class edr or a matrix"))
    if (dimbhat[2] < m) 
        return(warning("Argument m is to large"))
    t(svd(B, nv = 0)$u[, 1:m, drop = FALSE])
}
<bytecode: 0x37feeb0>
<environment: namespace:EDR>
 --- function search by body ---
Function edr.R in namespace EDR has this body.
 ----------- END OF FAILURE REPORT -------------- 
Fatal error: the condition has length > 1