On 2011-11-28 14:36, Luca Beltrame wrote:
In data lunedì 28 novembre 2011 14:31:57, Laurent Gautier ha scritto:
def as_dataframe(m):
assert(isinstance(m, Matrix))
# since we did test that this is a Matrix
# we may as well skip R's dispatch system
res = base.as_data_frame_matrix(m)
return res
At least on my applications, which make use of importr() quite a lot, I notice
that there is a significant (but unscientifically observed) delay when using
importr().
There will be a noticeable, albeit small, delay before you get back the
prompt after calling "importr". The larger the package the more
noticeable it will be.
This is because behind the scene rpy2 is loading the R package, going
through all its content and convert object names and parameter names in
function signatures.
If the code is already using it somewhere else in the same module,
then it would not matter, however (at least IMO).
Unless you have reason, you should avoid repeatedly calling "importr()"
over the same R package (or unnecessary work will be done by the
computer). Once you imported the R package, you are set. Just pass the
Package object if you have to.
In rpy2.rinteractive, there is a tentative way to prevent unnecessary
work to take place, even if calling "importr()" several times for the
same R package.
------------------------------------------------------------------------------
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
------------------------------------------------------------------------------
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