Use unlist.
In any case, don't write an explicit loop over
the columns. See ?lapply instead.
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: 05 September 2003 16:08
To: [EMAIL PROTECTED]
Subject: [R] all values from a data frame
Security Warning:
If
Dear Arne,
At 05:07 PM 9/5/2003 +0200, [EMAIL PROTECTED] wrote:
Hello,
I've a data frame with 15 colums and 6000 rows, and I need the data in a
single vector of size 9 for ttest. Is there such a conversion function in
R, or would I have to write my own loop over the colums?
thanks
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
[EMAIL