Hi,
library(reshape)
foo$id<-row.names(foo)
melt(foo,id.var="id")
id variable value
#1 n w 1.51550092
#2 q w 0.09977303
#3 r w 1.17083866
#4 n x 1.43375720
#5 q x 0.81737610
#6 r x 1.24693470
#7 n y 1.27916240
#8 q y 1
newdf<-data.frame(k1=rep(row.names(foo),ncol(foo)),stack(foo))
--- On Fri, 1/2/13, Gundala Viswanath wrote:
From: Gundala Viswanath
Subject: [R] Transforming 4x3 data frame into 2 column df in R
To: "r-h...@stat.math.ethz.ch"
Date: Friday, 1 February, 2013, 11:30 AM
I have the following dat
Dear Gundala,
Try
as.data.frame.table(foo)
HTH,
Jorge.-
On Fri, Feb 1, 2013 at 5:00 PM, Gundala Viswanath <> wrote:
> I have the following data frame:
>
> > foo
>w x y z
> n 1.51550092 1.4337572 1.2791624 1.1771230
> q 0.09977303 0.8173761 1.6123402 0.15107
3 matches
Mail list logo