Thanks for the messages. What I probably should have explained is that I have a data.frame "file" with variables named "A", "B", etc.. I wanted to use paste () to pull the names "file$A", "file$B", etc. and stick them in table() and so get an output of table(file$A). For the record, someone read my thinking and sent the following solution which works well:
table(eval(parse(text=risk.factors[1]))) Thanks again. David. -----Message d'origine----- De : Sarah Goslee [mailto:[EMAIL PROTECTED] Envoyé : lundi 9 juin 2008 21:00 À : EVANS David-William Objet : Re: [R] Probs with paste As another poster said, you didn't actually tell us what you wanted. But I wouldn't be at all surprised if ?get is just what you're looking for. Sarah 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 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(paste(risk.factors[1])) > > > > but run into problems with the table (paste...) line as I get the > following output: > > > >> table(paste(risk.factors[1])) > > > -- Sarah Goslee http://www.functionaldiversity.org ______________________________________________ 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.