Thank you all for the precious help. Finally i could start the writing of a first part of my script, but now i have a new question for you.
Need i to repeat the write.table portion for all the 15 lines or can i use a "short cut"? Example: file.open <- "C:\\test.txt" file.save <- "C:\\results.txt" my.data <- read.table(file, header=T) library(plyr) write.table(ddply(my.data, .(Thesis, Day), function(x){ Baseline <- unlist(x[1, c("A", "B", "C")]) data.frame(t(apply(x[-1, c("A", "B", "C")], 1, function(z){z - Baseline}))) }), file = file.save, row.names = F) write.table(ddply(my.data, .(Thesis, Day), function(x){ Baseline <- unlist(x[2, c("A", "B", "C")]) data.frame(t(apply(x[-1:-2, c("A", "B", "C")], 1, function(z){z - Baseline}))) }), file = file.save, append = T, row.names = F, col.names = F) etc etc Thanks again for the help. Best regards, Roberto. -- View this message in context: http://r.789695.n4.nabble.com/Comparison-of-numbers-in-a-table-tp3217329p3218524.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.