In data sabato 26 novembre 2011 06:53:48, Laurent Gautier ha scritto: > Currently, the constructor to DataFrame accepts a "tlist" ("tagged > list") as a main parameter. The idea was to be relying on duck-typing,
Currently in fact I've been hitting some walls regarding that. I assume that the low-level interface should be used to reduce overhead. Currently setting a matrix by tlist will fail because the type is not VECSXP, but rather of the type that it was generated from (eg. ints if it was created by an IntVector). So that brings the first question: how can I reliably detect that "tlist" is a Matrix? I thought about using isinstance() but I'm not sure if that would introduce overhead. I noticed that the code tries to create key, value pairs in tuples which then are sent to rcall() to create the object: in the specific case of Matrix, this messes up the column order (rows become columns). To be precise, the code I *tried* to use: kv = [(k, v) for k, v in tlist.iteritems()] kv = tuple(kv) df = baseenv_ri.get("data.frame").rcall(kv, globalenv_ri) super(DataFrame, self).__init__(df) which doesn't really work (creates rows as columns). -- Luca Beltrame, Ph.D. - Translational Genomics Unit Oncology Department, Mario Negri Institute
signature.asc
Description: This is a digitally signed message part.
------------------------------------------------------------------------------ All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-novd2d
_______________________________________________ rpy-list mailing list rpy-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rpy-list