[R] combine variables to matrix
m_olshansky at yahoo.com
Wed Dec 12 23:50:48 CET 2007
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 <ajung at gfz-potsdam.de> 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:
> For small data sets
> data <- read.table("data.txt");
> data.matrix <- cbind(V1,V2,V3);
> works. But how could I put together 1200 columns?
> I've searched the R mailing help and stumbled upon
> this entry:
> which doesn't help me.
> thanks for your help.
> > ______________________________________________
> R-help at r-project.org mailing list
> PLEASE do read the posting guide
> and provide commented, minimal, self-contained,
> reproducible code.
More information about the R-help