RE: [R] flatten a matrix and unflatten it

From: Bill Simpson <William.Simpson_at_drdc-rddc.gc.ca>
Date: Wed 23 Mar 2005 - 00:22:22 EST


Sorry -- I meant to say "dataframe" instead of matrix.

Anyway I see that my troubles are gone when I scan the data in as a vector then convert to matrix. (I had troubles doing such manipulations when I read in the data using read.table)

x<-scan("/home/wsimpson/papers/face/max.dat") xx<-matrix(x, ncol=3, nrow=length(x)/3, byrow=T)

Thanks for the help.

Bill



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Wed Mar 23 00:39:11 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:30:52 EST