[R] complex(?) reshaping question

2008-12-05 Thread Lauri Nikkinen
Hello, I have a problem with data reshaping. Here's my data DF - structure(list(idvar1 = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L), .Label = c(patient1, patient2 ), class = factor), idvar2 = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L), .Label =

Re: [R] complex(?) reshaping question

2008-12-05 Thread hadley wickham
I'm trying to omit NA:s in this DF and produce a reduced DF. The problem is that I cannot completely omit NA rows. I tried library(reshape) g - melt(DF, id=c(idvar1, idvar2)) g - na.omit(g) You're missing an id variable: DF$idvar3 - 1:2 g - melt(DF, id=c(idvar1, idvar2, idvar3), na.rm =