[R] all values from a data frame

partha_bagchi@hgsi.com partha_bagchi at hgsi.com
Fri Sep 5 17:25:11 CEST 2003

If I understand you correctly, you want to stack the 15 columns on top of 
one another? I assuming all the data is numeric?

In this case, convert the data.frame to a matrix and set the dim of the 
matrix to NULL.

If df is the data.frame,
df1 <- as.matrix(df)
dim(df1) <- NULL

<Arne.Muller at aventis.com>
Sent by: r-help-bounces at stat.math.ethz.ch
09/05/2003 11:07 AM

        To:     <r-help at stat.math.ethz.ch>
        Subject:        [R] all values from a data frame


I've a data frame with 15 colums and 6000 rows, and I need the data in a
single vector of size 90000 for ttest. Is there such a conversion function 
R, or would I have to write my own loop over the colums?

thanks for your help + kind regards


R-help at stat.math.ethz.ch mailing list

This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

More information about the R-help mailing list