Running 'ggplot.R' [5s]
  Running 'lasso.R' [3s]
  Running 'methods.R' [1s]
  Running 'unattached.R' [3s]
Running the tests in 'tests/ggplot.R' failed.
Complete output:
  > if(require(ggplot2)){
  +   library(directlabels)
  +   data(mpg,package="ggplot2")
  +   plots <-
  +     list(qplot=qplot(hwy,cty,data=mpg,colour=class),
  +          ggplot=ggplot(mpg,aes(hwy,cty,colour=class))+geom_point(),
  +          aes2=ggplot(,aes(hwy,cty))+geom_point(aes(colour=class),data=mpg),
  +          aes22=ggplot(,aes(colour=class))+geom_point(aes(hwy,cty),data=mpg),
  +          geom=ggplot()+geom_point(aes(hwy,cty,colour=class),data=mpg),
  +          mix=ggplot(mpg)+geom_point(aes(hwy,cty,colour=class)),
  +          mix2=ggplot(,aes(hwy,cty,colour=class))+geom_point(data=mpg))
  +   for(i in seq_along(plots)){
  +     p <- plots[[i]]
  +     p.name <- names(plots)[[i]]
  +     print(p.name)
  +     dl <- direct.label(p)
  +     print(dl)
  +   }
  + 
  + 
  +   ## Test for legend hiding.
  +   iris0 <- ggplot(iris, aes(Sepal.Width, Petal.Width))+geom_point()+
  +     geom_density2d(aes(group=Species))
  +   iris1 <- iris0+aes(colour=Species)
  +   iris2 <- iris1+aes(size=Petal.Length)
  +   ## two legends combined:
  +   iris1leg <- iris1+aes(size=Species)
  +   iris2leg <- iris2+aes(shape=Species)
  +   ## only fill:
  +   data(projectionSeconds, package="directlabels")
  +   pFill <- ggplot(projectionSeconds, aes(vector.length/1e6, mean))+
  +     geom_ribbon(aes(ymin=min, ymax=max, 
  +                     fill=method, group=method), alpha=1/2)
  +   pShape <- pFill+geom_point(aes(shape=method))
  +   pLine <- pFill+
  +     geom_line(aes(group=method, colour=method))
  +   pLinetype <- pLine+aes(linetype=method)
  +   pSize <- pLinetype+geom_point(aes(size=sd))
  +   expect <- function(p, col=NULL, hide=NULL)list(plot=p, colour=col, hide=hide)
  +   library(nlme)
  +   rp2 <- qplot(Time,weight,data=BodyWeight,geom="line",facets=.~Diet,colour=Rat)
  +   to.test <- list(expect(iris0),
  +                   expect(rp2, "colour", "colour"),
  +                   expect(iris1, "colour", "colour"),
  +                   expect(iris2, "colour",  "colour"),
  +                   expect(iris1leg, "colour", c("colour", "size")),
  +                   expect(iris2leg, "colour", c("colour", "shape")),
  +                   expect(pFill, "fill", "fill"),
  +                   expect(pShape, "fill", c("fill", "shape")),
  +                   expect(pLine, "colour", c("fill", "colour")),
  +                   expect(pLinetype, "colour", c("fill", "colour", "linetype")),
  +                   expect(pSize, "colour", c("fill", "colour", "linetype")))
  +   for(L in to.test){
  +     ## Visual check: in the direct labeled plot on the right, is the
  +     ## colour legend missing? Is the other legend still there?
  +     
  +     result <- legends2hide(L$plot)
  +     if(is.null(result$hide) && is.null(L$hide)){
  +       ##negative control, ok!
  +     }else{
  +       dlcompare(list(L$plot), list("legend", "get.means"))
  +       
  +       stopifnot(result$hide %in% L$hide)
  +       stopifnot(length(result$hide) == length(L$hide))
  +       stopifnot(L$colour == result$colour)
  +       ## label it and check for different legends.
  +       dl <- direct.label(L$plot)
  +       after <- legends2hide(dl)
  +       stopifnot(is.null(after))
  +     }
  +   }
  + }
  Loading required package: ggplot2
  [1] "qplot"
  Error in `[<-.data.frame`(`*tmp*`, is.na(cm.data[, p]), p, value = 0.5) : 
    replacement has 1 row, data has 0
  Calls: print ... drawDetails -> drawDetails.dlgrob -> [<- -> [<-.data.frame
  Execution halted
Running the tests in 'tests/lasso.R' failed.
Complete output:
  > library(directlabels)
  > data(prostate,package="ElemStatLearn")
  > pros <- subset(prostate,select=-train,train==TRUE)
  > ycol <- which(names(pros)=="lpsa")
  > x <- as.matrix(pros[-ycol])
  > y <- pros[[ycol]]
  > library(lars)
  Loaded lars 1.2
  
  > fit <- lars(x,y,type="lasso")
  > beta <- scale(coef(fit),FALSE,1/fit$normx)
  > 
  > ## Degenerate case: one 0 curves.
  > beta[, "gleason"] <- 0
  > arclength <- rowSums(abs(beta))
  > path <- data.frame(
  +   step=as.integer(row(beta)),
  +   variable=colnames(beta)[as.integer(col(beta))],
  +   arclength=arclength[as.integer(row(beta))],
  +   standardized.coef=as.numeric(beta))
  > library(ggplot2)
  > p <- ggplot(path,aes(arclength,standardized.coef,colour=variable))+
  +   geom_line(aes(group=variable))+
  +   ggtitle("LASSO path for prostate cancer data calculated using the LARS")+
  +   xlim(0,20)
  > print(direct.label(p,"lasso.labels"))
  Error in `[<-.data.frame`(`*tmp*`, is.na(cm.data[, p]), p, value = 0.5) : 
    replacement has 1 row, data has 0
  Calls: print ... drawDetails -> drawDetails.dlgrob -> [<- -> [<-.data.frame
  Execution halted
Running the tests in 'tests/methods.R' failed.
Complete output:
  > library(directlabels)
  > data(BodyWeight, package="nlme")
  > library(lattice)
  > oldopt <- lattice.options(panel.error=NULL)
  > p <- xyplot(weight~Time|Diet,BodyWeight,groups=Rat,type='l',
  +             layout=c(3,1),xlim=c(-10,75))
  > stop.if.same.colour <- function(d, ...){
  +   col.tab <- table(d$colour)
  +   if(1 == length(col.tab)){
  +     print(d)
  +     stop("only one colour")
  +   }
  +   d
  + }
  > dl <- direct.label(p, list("angled.boxes", "stop.if.same.colour"))
  > print(dl)
  Error in `[<-.data.frame`(`*tmp*`, is.na(cm.data[, p]), p, value = 0.5) : 
    replacement has 1 row, data has 0
  Calls: print ... drawDetails -> drawDetails.dlgrob -> [<- -> [<-.data.frame
  Execution halted
Running the tests in 'tests/unattached.R' failed.
Complete output:
  > if(require(ggplot2)){
  +   if("package:directlabels" %in% search()){
  +     detach("package:directlabels")
  +   }
  +   no.labels <- ggplot(iris, aes(Petal.Length, Petal.Width, color=Species))+
  +     geom_point()
  +   with.labels <- no.labels+
  +     directlabels::geom_dl(aes(label=Species), method="smart.grid")
  +   print(with.labels)
  +   detach("package:ggplot2")
  +   directlabels::direct.label(no.labels, "smart.grid")
  + }
  Loading required package: ggplot2
  Error in `[<-.data.frame`(`*tmp*`, is.na(cm.data[, p]), p, value = 0.5) : 
    replacement has 1 row, data has 0
  Calls: print ... drawDetails -> drawDetails.dlgrob -> [<- -> [<-.data.frame
  Execution halted