Duncan, Mark, et al., > It's a scoping problem. To be helpful, subset looks up variables within > the dataframe first. Since it can find Subj there, that's the one it > uses in the test. > > The easiest solution is just to make sure that Subj is named something > that isn't a column of Trials, e.g. localSubj. Then you could use > > subset(Trials, Subj == localSubj[1])
This works perfectly, as does > thisSubj <- Trials[Trials$Subj == Subj[1], ] I had tried the latter method awhile ago when I was first learning, but I had been missing the final comma, and had come to the conclusion that this method only worked when selecting a particular column of a data frame. Now I know better. Thanks so much for everyone's help. I am very impressed by the R community!!!! Rob -- Robert Felty http://robfelty.com "nunc est bibendum" -- Horace, Ode 37 ______________________________________________ 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.