Re: [R] Probs with paste

2008-06-09 Thread jim holtman
Try this: riskFactors <- c("A", "B", "C") table(file[[riskFactor[1]]]) in a loop for (i in riskFactor) table(file[[riskFactor[i]]]) On Mon, Jun 9, 2008 at 10:44 AM, EVANS David-William < [EMAIL PROTECTED]> wrote: > Hello all, > > > > After some months doing ok with R, I am embarrassed that I h

Re: [R] Probs with paste

2008-06-09 Thread Charilaos Skiadas
I have to say it is not clear at all what you expected. risk.factors [1] is the character vector "file$A". You ask it to do a paste of that, so of course it will just return itself. Then you do a table, and naturally it tells you that it found "file$A" exactly once. So what you have forgotte

[R] Probs with paste

2008-06-09 Thread EVANS David-William
Hello all, After some months doing ok with R, I am embarrassed that I have to make this my first posting to the help list. I am trying to run the following (actually in a loop but shortened for the post): risk.factors <- c("file$A", "file$B", "file$C", "file$D", "file$E") table(pas