> 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 = T) cast(g, idvar1 + idvar2 + idvar3 ~ variable) Hadley -- http://had.co.nz/ ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.