[datatable-help] Passing i, j and by to dt() as characters

Bacou, Melanie mel at mbacou.com
Fri Apr 13 08:01:00 CEST 2012


Hello,

I apologize in advance if this has been covered before, but I'm trying to
write a generic function that takes 3 URL parameters of the form:

http://my.url?param1='f1=a,f2=b'&param2='c,d'&param3='e,f' 

and simply pass them to dt(), so the expression to evaluate is:

dt[f1=="a" & f2=="b", list( t1(c), t2(d) ), by=list( e, f )]

where t1, t2 are custom aggregation functions.

I can't seem to find an elegant way to convert the strings to vector names.
Using .SDcols does work for the elements in j, but what about i and by?

Any tip would be very helpful!
Thanks, --Mel.

_______________________
 Melanie Bacou
 IFPRI / HarvestChoice
 Washington DC, 20006
 W +1(202)862-5699
 C +1(202)492-7978
 m.bacou at cgiar.org 




More information about the datatable-help mailing list