Re: [R] combine variables to matrix

2007-12-12 Thread Moshe Olshansky
You can always make a loop (V1 corresponds to column 1, etc.) but as.matrix() is simpler, i.e. in your case data.matrix <- as.matrix(data) --- Andre Jung <[EMAIL PROTECTED]> wrote: > I just got stuck with a quite simple question. I've > just read in an > ASCII table from a plain text file with

Re: [R] combine variables to matrix

2007-12-12 Thread Julian Burgos
Hi Andre, I don't quite understand what you are trying to do. Why you are using cbind to join columns of a dataset that it is already in table form? It is true that read.table will give you a data.frame instead of a matrix, but if for some reason you need a matrix you can do simply data.matr

Re: [R] combine variables to matrix

2007-12-12 Thread Peter Dalgaard
Andre Jung wrote: > I just got stuck with a quite simple question. I've just read in an > ASCII table from a plain text file with read.table(). It's a 1200x1200 > table. R has assigned variables for each column: V1,V2,V3,V4,... > For small data sets > > data <- read.table("data.txt"); > data.matrix

[R] combine variables to matrix

2007-12-12 Thread Andre Jung
I just got stuck with a quite simple question. I've just read in an ASCII table from a plain text file with read.table(). It's a 1200x1200 table. R has assigned variables for each column: V1,V2,V3,V4,... For small data sets data <- read.table("data.txt"); data.matrix <- cbind(V1,V2,V3); works.