Mark, Thanks for the reply.
> hi: subset doesn't know what i is but I don't have enough knowledge > about scope to know what it's actually doing in that case. my > point is that i wouldn't put i inside a subset command and expect it to > know the value. scope is very complex in R so > doing things in the simplest manner is best like the way you do it with > 49. hopfully someone else will reply with > a more detaild answer but i have a feeling that that is where your > problem lies. good luck. > I still get the wrong result without i: Subj[1] [1] "49" > thisSubj = subset(Trials,Trials$Subj=="49") > thisSubj$Ansr[1] [1] "able" > thisSubj = subset(Trials,Trials$Subj==Subj[1]) > thisSubj$Ansr[1] [1] "abacus" The problem is that I want to use this in a loop, so that I can get a score for every subject. Maybe there is an alternative way to do this? Rob -- Robert Felty http://robfelty.com Reality is known to have a liberal bias. -- Stephen Colbert ______________________________________________ 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.