I do not understand how to handle objects, stored in a data.frame, in certain lattice plots. In the second plot I get the error msg bellow. Is it possible to get it to work?
require(lattice)
require(latticeExtra)
data<-data.frame(a=I(list(1,2,3)),b=factor(1:3))
ecdfplot(~a|b,data=data
,layout=c(1,3)
,panel=function(x,...){
print(x[[1]])
panel.xyplot(x[[1]],.5,col=2)
}
)
data<-data.frame(a=I(list(diag(1,2,2),diag(1,2,2),diag(1,2,2))),b=factor(1:3))
ecdfplot(~a|b,data=data
,layout=c(1,3)
,panel=function(x,...){
print(x[[1]][1,1])
panel.xyplot(x[[1]][1,1],.5,col=2)
}
)
Error in prepanel.default.function(darg = list(give.Rkern = FALSE, n = 50, :
(list) object cannot be coerced to type 'double'