[R] Passing arguments from a function within another function

Gabor Grothendieck ggrothendieck at gmail.com
Tue Jun 27 04:01:49 CEST 2006


On 6/26/06, Aarti Dahiya <aarti_dahiya at hotmail.com> wrote:
> 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 at 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

More information about the R-help mailing list