[R] Passing arguments from a function within another function

Aarti Dahiya aarti_dahiya at hotmail.com
Tue Jun 27 00:17:09 CEST 2006


Hi all,

I have a function getSomeData() that is called from command line - 
getSomeData(id='1240'). The function getSomeData() calls another function 
getData that needs the exact same argument passed to getSomeData().  I am 
using the function call getData(paste(names(args[1]), "=", 
sQuote(args[[1]]))).  The argument passed is- id='1240'.

The problem is that in getData(), it treats the whole thing "id='1240'" as 
one arguments i.e. for getData args[[1]] is "id='1240'".  Hence, I am unable 
to extract the name id and the value of id separately.  Beacuse of this, I 
am not able to generate the SQL query select * from table where id = '1240'.

Thank you.

Aarti



More information about the R-help mailing list