Gavin Simpson <[EMAIL PROTECTED]> writes: >> df <- data.frame(resp = dat[,1], VARS = I(as.matrix(dat[, 2:101]))) >> class(df$VARS) > [1] "AsIs" > > The class is AsIs for $VARS. But if I look at your yarn data set for > example, the NIR component is of class "matrix": > >> class(yarn$NIR) > [1] "matrix" > > How did you achieve this?
I don't remember exactly what I did, but this will work, at least: yarn <- data.frame(density = ..., train = ...) yarn$NIR <- as.matrix(...) For practical purposes, I haven't found any difference between having the matrices with class "AsIs" and "matrix". -- Bjørn-Helge Mevik ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.