[R] How to get an argument dynamically from a list?

2008-06-29 Thread Stephane Bourgeois
Hi, I'd like to get an argument (I think it's the right term) dynamically from a list, but cannot manage to do it. Here is the code I use: #output given by database BOB - c('A/A', 'C/C', '15/27') MARY - c('A/A', NA, '13/12') JOHN - c('A/A', 'C/A', '154/35') CLIFF - c('A/C', 'C/C', '15/12')

Re: [R] How to get an argument dynamically from a list?

2008-06-29 Thread jim holtman
Is this what you want: you have to use data.raw[[polyList[2]]] to access the data. (see ?[[) lapply(polyList, function(x) as.character(data.raw[[x]])) [[1]] [1] A/A A/A A/A A/C A/C [[2]] [1] C/C NAC/A C/C C/A [[3]] [1] 15/27 13/12 154/35 15/12 13/12 On Sun, Jun 29, 2008 at 3:24 PM,