[R] Passing arguments from a function within another function

From: Aarti Dahiya <aarti_dahiya_at_hotmail.com>
Date: Tue 27 Jun 2006 - 08:17:09 EST


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



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Tue Jun 27 08:25:41 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Tue 27 Jun 2006 - 14:12:24 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.