Re: [R] Loop in variable names

2011-02-11 Thread Eik Vettorazzi
;- table(StoreData$CompanyID, !is.na(StoreData[,cut])) > assign(tab,t) > } > > table2 > table5 > > Is this the only way? Could I not have put table2 and table5 with an i > index inside the loop? > > Sorry to bother you. > Stella > > >> Date: W

Re: [R] Loop in variable names

2011-02-09 Thread jim holtman
Try: for(i in angus) { cut <- StoreData[[paste("P", i)]] table(StoreData$CompanyID, !is.na(cut)) } On Wed, Feb 9, 2011 at 1:02 PM, Rita Carreira wrote: > > > Hello! > I would like to do some tables for several variables and I would like to > write a loop that does the table for each variable

Re: [R] Loop in variable names

2011-02-09 Thread Eik Vettorazzi
Hi Stella, in your coding 'cut' is a string, not a data object. something like cut <- paste("P",i, sep="") table(StoreData$CompanyID, !is.na(StoreData[,cut])) should work. hth. Am 09.02.2011 19:02, schrieb Rita Carreira: > > > Hello! > I would like to do some tables for several variables an