Re: [R] Transform array in dataframe; melt(); reshape()

2009-08-11 Thread Patrick Connolly
On Tue, 11-Aug-2009 at 07:15PM +0100, Cecilia Carmo wrote: > Hi everyone. > > Could anyone help me to reshape my data? > > Reproducible example: > firm<-sort(rep(1:1000,10),decreasing=F) > year<-rep(1998:2007,1000) > industry<-rep(c(rep(1,10),rep(2,10),rep(3,10),rep(4,10),rep(5,10),rep(6,10),rep(7

[R] Transform array in dataframe; melt(); reshape()

2009-08-11 Thread Cecilia Carmo
Hi everyone. Could anyone help me to reshape my data? Reproducible example: firm<-sort(rep(1:1000,10),decreasing=F) year<-rep(1998:2007,1000) industry<-rep(c(rep(1,10),rep(2,10),rep(3,10),rep(4,10),rep(5,10),rep(6,10),rep(7,10),rep(8,10),rep(9,10), + rep(10,10)),1000) X1<-rnorm(1) X2<-rnorm(