Re: [R] long format with reshape

2013-01-24 Thread arun
oject.org" Cc: Sent: Thursday, January 24, 2013 5:06 AM Subject: [R] long format with reshape Hello, I tried using reshape to rearrange my data to long format but I could not get the output the table they way I wanted it. Anyway I came up with a hack that does works, but I still would like to

Re: [R] long format with reshape

2013-01-24 Thread Gerrit Eichner
Hi, Daisy, try dat2 <- reshape( dat, varying = c( "species1", "species2", "species3"), v.name = "presence", timevar = "species", times = c( "species1", "species2", "species3"), direction="long") dat2[ rev( order( dat2$region)), ] Hth -- Ger

[R] long format with reshape

2013-01-24 Thread Daisy Englert Duursma
Hello, I tried using reshape to rearrange my data to long format but I could not get the output the table they way I wanted it. Anyway I came up with a hack that does works, but I still would like to know if I can do it with reshape. Here is my code and a dummy set of data. It returns the data in