I am trying to build a data.frame from some vectors and some matrices and seem to be unable to find out how to do this without converting everything to factors. I can prevent conversion of the vectors by using I(), as explained in help(data.frame). However, this doesn't help with the matrices: if I try I() with the matrix, the matrix gets incorporated into the data frame as a whole, rather than as a list of vectors as it should be. ("as.is=T" doesn't help either, and neither does "options(stringsAsFactors = FALSE)".)
I think we need the reproducible example we asked for. I get > z <- matrix(letters[1:12], 4, 3) > z2 <- data.frame(x=1:4, z=z, stringsAsFactors=FALSE) > sapply(z2, class) x z.1 z.2 z.3 "integer" "character" "character" "character" so it is working as documented. (BTW, using I() on a matrix is intended to insert a matrix as a single entity, and as.is is not an argument to data.frame.) -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595 ______________________________________________ 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.