[R] Problem with "list"

Christofer Bogaso bogaso.christofer at gmail.com
Sun Sep 19 12:21:58 CEST 2010


Dear all, I have following list object:

dat <- vector("list", length=4)
for(i in 1:4) dat[[i]] <- diag(rnorm(5)^2)
names(dat) <- paste("A", 1:4, sep="")

It is ok upto this point. However if I want apply, suppose chol()
function on any of it's element, I am getting error:

> chol(dat['A1'])
Error in chol.default(dat["A1"]) : non-numeric argument to 'chol'

Can somebody point me where I am doing wrong?

Thanks and regards,



More information about the R-help mailing list