Hi The reshape suggestions works great on my previous data, but I am unable to make is work on the new dataset. It actually works but only gives me the output of single row, instead of 96 rows. The dataset has two control groups control 1 and control 2, two disease groups viz disease 1 and disease 2 a total of 384 values plate.id well.id Group HYB rlt1 P1 A1 control1 SKOV3hyb 0.19 P1 A2 disease1 SKOV3hyb 0.21 P1 A3 control1 SKOV3hyb 0.205 P1 A4 disease1 SKOV3hyb 0.206 P1 B1 disease2 SKOV3hyb 0.217 P1 B2 control2 SKOV3hyb 0.646 P1 B3 disease2 SKOV3hyb 0.371 P1 B4 control2 SKOV3hyb 0.56
when I use ydat <- reshape(ydat, idvar = c('plate.id','HYB'), timevar ='Group',direction = 'wide') I get plate.id well.id.control1 HYB.control1 rlt1.control1 well.id.disease1 HYB.disease1 rlt1.disease1 well.id.disease2 HYB.disease2 rlt1.disease2 well.id.control2 HYB.control2 rlt1.control2 P1 A1 SKOV3hyb 0.19 A2 SKOV3hyb 0.21 B1 SKOV3hyb 0.217 B2 SKOV3hyb 0.646 instead of 96 rows of data, only one row comes, i tried new.row.names but that is not working. I would appreciate the help. Thanks -- View this message in context: http://r.789695.n4.nabble.com/subtraction-based-on-two-groups-in-a-dataframe-tp2716104p2966918.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ 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.