> for (i in 1:(dat[(unique(dat$Subject)),)] I don't think the order of the parentheses when you open the loop is correct. You have four (s and only three )s. Plus the brackets (square parentheses) seem so be out of order too.
If you use RStudio to write your code, when you highlight a parenthesis, it will highlight the corresponding closing one. HTH, Rita -- View this message in context: http://r.789695.n4.nabble.com/Loop-through-each-subject-tp3631046p3631105.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.